public function get_products_count( $type = null, $filter = array() ) {
        try {
            if ( ! current_user_can( 'read_private_products' ) ) {
                throw new WC_API_Exception( 'woocommerce_api_user_cannot_read_products_count', __( 'You do not have permission to read the products count', 'woocommerce' ), 401 );
            }