Advanced Newsletter Suite for Magento 2
€75.00 €75.00
Kowal_ExportImportCategories is a Magento 2 module that enables the export and import of category attributes in CSV format for a selected store view. The extension was created for stores that operate in multiple languages, use multiple store views, or need to update category data in bulk without manually editing each category in the admin panel.
The module lets you export categories to a CSV file, modify selected attributes outside Magento, and then import the data back in either update mode for existing categories or insert mode for creating new categories. Import runs for the specified store view, making it convenient to prepare translations of names, descriptions, meta tags, URLs, and other category attributes.
The module is designed for:
store view.store view.update.insert.select and multiselect attributes by option labels.dry-run mode, meaning full import validation without saving data.url_key handling strategies.Export lets you generate a CSV file with categories for the selected store view. The administrator selects the store view and the category attributes to include in the file. The module automatically adds the system columns required to identify categories and preserve the tree structure.
Export can be used to:
Export includes category attributes. The module does not export products assigned to categories. It also does not perform category deletion operations.
The administrator can select:
Store View,The module supports two value export modes:
resolved_value - exports the value visible in the given store view, meaning after applying Magento fallback to the default value.store_override_only - exports only the value overridden directly for the given store view; if the value is inherited, the CSV cell remains empty.resolved_value mode is convenient for editorial work because it shows the actual value visible in the store. store_override_only mode is useful when you need to control only translations or overrides specific to a given store view.
Import lets you load a CSV file and save selected category attributes for the specified store view. The store view selected in the import form takes precedence, while the store_view_code column from the CSV is used to validate whether the file matches the selected store view.
Import can be used to:
url_key,update modeupdate mode updates existing categories. The module does not create new categories in this mode.
A category is searched primarily by entity_id. If entity_id is not available, the module can use category_path, provided that the path clearly identifies a single category.
update mode is recommended for:
Example translation scenario:
store_view_code in the CSV to the target store view code.entity_id values.name, description, meta_title, and meta_description columns.update mode for the target store view.In this variant, the module saves selected attributes in the context of the numeric store_id selected in the import form.
insert modeinsert mode creates new categories. In this mode, entity_id is not required because Magento assigns it automatically.
A new category must have its parent specified by:
parent_entity_id,parent_path.insert mode is recommended for:
If the import includes both a parent and a child, the data should be ordered from higher-level categories to lower-level categories.
The first row of the CSV file must contain column headers. Columns are divided into:
Attribute columns must match Magento attribute codes, for example:
name,url_key,description,meta_title,meta_description,is_active,include_in_menu.The module uses the following system columns:
store_view_code,entity_id,parent_entity_id,category_path,parent_path,level,position,attribute_set_id.System columns are not treated as EAV attributes. They are used to identify categories, validate the store view, and recreate the tree structure.
store_view_code,entity_id,category_path,name,url_key,is_active,include_in_menu,meta_titlepl,13,Default Category/Gear/Bags,Torby,torby,1,1,Torbypl,14,Default Category/Gear/Fitness Equipment,Sprzet fitness,sprzet-fitness,1,1,Sprzet fitnessstore_view_code,parent_entity_id,parent_path,category_path,name,url_key,is_active,include_in_menudefault,12,Default Category/Gear,Default Category/Gear/Helmets,Helmets,helmets,1,1default,12,Default Category/Gear,Default Category/Gear/Gloves,Gloves,gloves,1,1The module saves values in CSV as text. This allows the file to be edited in a spreadsheet, sent to a translator, or prepared automatically in an external system.
For select and multiselect attributes, the module works with option labels rather than technical option IDs. This means the CSV contains readable values such as Products only, Position, or Price.
For multiselect, multiple values are separated with the | delimiter.
Example:
store_view_code,entity_id,category_path,display_mode,available_sort_by,default_sort_bydefault,13,Default Category/Gear/Bags,Products only,Position|Product Name|Price,PositionIf an option label does not exist or is not unique, the import will report a validation error.
During import, the administrator selects how empty CSV cells should be interpreted:
skip_empty - an empty cell does not change the existing value.clear_value - an empty cell clears the attribute value for the selected store view.use_default - an empty cell removes the store view override and lets Magento use the default value.The recommended default option for updates is skip_empty, because it reduces the risk of accidentally clearing data.
The module lets you configure the url_key handling strategy:
use_csv_value - uses the value from the CSV.generate_from_name - generates url_key based on the name attribute.keep_existing - keeps the current url_key in update mode.magento_default - leaves URL handling to the standard Magento mechanism.The administrator can also decide whether permanent redirects should be created when url_key changes.
This configuration is especially important for translations, because different stores may use different strategies:
The module can import category image attributes if the relevant columns are selected for import.
Default source directory:
pub/media/import/categoriesThe CSV contains a text path relative to this directory, for example:
gear/bags.jpgThe module validates file existence and extension. Safe image formats are supported, such as:
jpg,jpeg,png,webp,gif.dry-run mode lets you run import validation without saving data in Magento.
In this mode, the module:
select and multiselect values,This is the recommended first step before every larger import.
Import runs in batches. The batch size can be configured in the import form.
Default value:
100 wierszyBatch processing reduces the risk of timeouts and excessive memory usage with larger files.
The module supports three behavior variants for errors:
skip_invalid_rows - invalid rows are skipped, while valid rows continue to be imported.stop_on_first_error - import stops after the first error.all_or_nothing - if any row has an error, data is not saved.The recommended option for large imports is skip_invalid_rows, because it allows valid data to be processed and provides a problem report for the remaining rows.
After import, the module generates a CSV report containing:
Import history is available in the admin panel. The administrator can check:
dry-run,The module uses Magento ACL and adds separate permissions for export, import, and import history.
Import is secured by:
The module does not delete categories and does not import products assigned to categories.
Export categories from the base store view, fill in translations in the CSV, change store_view_code to the target store view code, and import the data in update mode.
Export the meta_title, meta_description, and url_key attributes, edit them in the CSV, and import only the selected columns.
Prepare a CSV file with category_path, parent_path, name, and other required attributes, then import it in insert mode.
If the store has custom category attributes, the module loads them dynamically from EAV and lets you select them during export and import.
After installation, the module is available at:
System > Data Transfer > Export/Import CategoriesAvailable views:
Export Categories,Import Categories,Import History.tandembaits.com to sklep internetowy działający w branży wędkarskiej. Oferta sklepu jest oparta na specjalistycznym asortymencie, w którym poprawne nazwy kategorii, precyzyjne opisy oraz dobrze przygotowane adresy URL mają bezpośrednie znaczenie dla użyteczności sklepu, SEO i komunikacji z klientami w różnych krajach.
W ramach rozbudowy sklepu o nowe wersje językowe klient potrzebował skutecznego sposobu zarządzania kategoriami w Magento 2.
Największym problemem była specyfika branży wędkarskiej. Nazwy kategorii nie są prostymi, uniwersalnymi etykietami. Często odnoszą się do konkretnych technik łowienia, typów przynęt, akcesoriów, serii produktowych albo pojęć używanych tylko przez zaawansowanych wędkarzy.
Przy 10 wersjach językowych ręczne zarządzanie kategoriami w panelu Magento było zbyt czasochłonne i podatne na błędy. Klient potrzebował mieć pełną kontrolę nad:
Skala pracy obejmowała kilkadziesiąt kategorii w 10 wersjach językowych. Oznaczało to setki wartości tekstowych do przygotowania, sprawdzenia, poprawienia i zaimportowania.
Standardowa praca w panelu Magento wymagałaby edycji każdej kategorii osobno dla każdego store view. Przy kilkudziesięciu kategoriach i 10 językach taki proces byłby powolny i trudny do kontrolowania.
Najważniejsze ryzyka przy ręcznej pracy:
Klient potrzebował procesu, który pozwoli przygotować dane zbiorczo, sprawdzić je przed importem i bezpiecznie zapisać tylko wybrane atrybuty dla konkretnego store view.
Dla tego scenariusza zastosowano moduł Export Import Categories dla Magento 2.
Moduł umożliwił eksport kategorii do pliku CSV, przygotowanie danych językowych poza panelem Magento oraz ponowny import wartości do wybranego store view.
Proces został oparty na trybie update, ponieważ struktura kategorii już istniała w sklepie. Celem nie było tworzenie nowego drzewa kategorii, ale uzupełnienie i poprawienie danych dla kolejnych wersji językowych.
W projekcie kluczowe były następujące funkcje modułu:
entity_id jako stabilnego identyfikatora kategorii,store_view_code na kod docelowej wersji językowej,update,url_key,Najpierw wykonano eksport kategorii z bazowego store view. Plik CSV zawierał kolumny systemowe oraz wybrane atrybuty wymagane do przygotowania wersji językowych.
Najważniejsze kolumny systemowe:
store_view_code,entity_id,category_path,parent_path.Najważniejsze atrybuty robocze:
name,url_key,description,meta_title,meta_description.Na podstawie wyeksportowanego CSV przygotowano osobne dane dla poszczególnych wersji językowych.
Dzięki temu osoby odpowiedzialne za treści mogły pracować w arkuszu, widząc wiele kategorii jednocześnie. Było to szczególnie ważne w branży wędkarskiej, gdzie nazwy kategorii muszą być zgodne z lokalną terminologią i realnym sposobem wyszukiwania produktów przez klientów.
W plikach importowych zachowano entity_id, aby moduł mógł jednoznacznie dopasować wiersze CSV do istniejących kategorii Magento.
To pozwoliło importować tłumaczenia bez ryzyka utworzenia duplikatów kategorii.
Dla każdej wersji językowej ustawiano odpowiedni store_view_code w CSV oraz wybierano ten sam store view w formularzu importu.
Moduł walidował zgodność tych danych. Dzięki temu ograniczono ryzyko przypadkowego importu tłumaczeń do niewłaściwego widoku sklepu.
Import wykonywano w trybie update, wybierając tylko te atrybuty, które miały zostać zmienione dla danej wersji językowej.
Dzięki temu moduł nie ingerował w pozostałe dane kategorii.
Przed właściwym importem można było uruchomić walidację bez zapisu danych.
Tryb dry-run pozwalał sprawdzić:
store_view_code pasuje do wybranego store view,entity_id wskazuje istniejące kategorie,Po imporcie moduł generował raport, który pozwalał sprawdzić status poszczególnych wierszy.
Raport był szczególnie przydatny przy pracy na wielu językach, ponieważ pozwalał szybko wykryć ewentualne błędy w konkretnym pliku albo konkretnej kategorii.
CSV był praktycznym formatem dla tego projektu, ponieważ:
entity_id i store_view_code.Moduł umożliwił klientowi zarządzanie kategoriami w 10 wersjach językowych w sposób uporządkowany i powtarzalny.
Zamiast ręcznej edycji każdej kategorii w panelu Magento, zespół mógł pracować na plikach CSV, przygotowywać tłumaczenia zbiorczo i importować tylko wybrane atrybuty dla konkretnego store view.
Najważniejsze korzyści:
W projekcie szczególne znaczenie miała możliwość kontrolowania url_key, nazw kategorii oraz opisów.
Dla sklepu działającego w wielu językach automatyczne tłumaczenie lub przypadkowe kopiowanie nazw kategorii nie jest wystarczające. Każdy rynek może używać innych określeń branżowych, a w wędkarstwie różnice terminologiczne są szczególnie istotne.
Moduł pozwolił przygotować wartości SEO świadomie dla każdej wersji językowej:
Rozbudowa tandembaits.com o 10 wersji językowych wymagała narzędzia, które pozwoli sprawnie zarządzać kategoriami Magento 2 na poziomie store view.
Export Import Categories rozwiązał ten problem, przenosząc pracę z ręcznej edycji w panelu Magento do kontrolowanego procesu opartego o CSV, walidację i import wybranych atrybutów.
W efekcie klient otrzymał możliwość wygodnego zarządzania specjalistycznymi nazwami kategorii, adresami URL i opisami dla wielu języków bez ryzyka przypadkowego nadpisania całej struktury kategorii.
This document describes the installation, configuration, and use of the Kowal_ExportImportCategories module for Magento 2. The guide includes information from the README.md file and the features implemented in the module.
8.1 or newer recommended.pub/media/import/categories directory.The module is available through a Composer repository.
composer config repositories.export.import.categories vcs https://github.com/kowalco/export-import-categoriesIf the repository is private, configure a GitHub token:
composer config --global --auth github-oauth.github.com Replace with your own access token.
composer require kowal/module-export-import-categoriesbin/magento module:enable Kowal_ExportImportCategoriesbin/magento setup:upgradebin/magento cache:flushOn production environments or in production mode:
bin/magento setup:di:compileIf the environment requires it:
bin/magento setup:static-content:deploybin/magento cache:flushAlternatively, you can place the module manually in the directory:
app/code/Kowal/ExportImportCategoriesAfter copying the files, run:
bin/magento module:enable Kowal_ExportImportCategoriesbin/magento setup:upgradebin/magento cache:flushIn production mode, also run:
bin/magento setup:di:compileAfter installation, check whether the module is active:
bin/magento module:status Kowal_ExportImportCategoriesThe module should appear on the list of active modules.
In the admin panel, go to:
System > Data Transfer > Export/Import CategoriesYou should see three items:
Export Categories,Import Categories,Import History.The module adds separate admin permissions:
Export/Import Categories section,If an admin user does not see the module menu, check the user role in:
System > Permissions > User RolesThen grant the appropriate permissions for the module resources.
The module is available at:
System > Data Transfer > Export/Import CategoriesViews:
Export Categories - export categories to CSV.Import Categories - import categories from CSV.Import History - import history and reports.The export view lets you generate a CSV file with categories.
Selects the store view from which category attribute values will be read.
If you select a language store view, the export may include values specific to that store view or values inherited from the default scope, depending on the value mode.
An optional field that lets you limit the export to a selected category and its subtree.
If the field is left empty, the module exports categories from the root category of the selected store view.
Defines how store view-dependent values are exported.
Available options:
resolved_value,store_override_only.resolved_value exports the value visible in the selected store view after applying Magento fallback.
store_override_only exports only the value overridden for the selected store view. If the value is inherited from the default scope, the CSV cell will be empty.
CSV delimiter. Default:
,You can use a different delimiter if the file will be edited in a tool that requires, for example, a semicolon.
List of category attributes available in Magento.
The module loads attributes dynamically from EAV, so the list may also include custom category attributes added in the project.
System columns are added automatically and do not need to be selected.
Export should always include system columns:
store_view_code,entity_id,parent_entity_id,category_path,parent_path,level,position,attribute_set_id.These columns are used to identify categories, validate the store view, and handle the tree structure.
The import view lets you load a CSV and save category data.
Selects the store view to which values will be saved.
This field determines the numeric store_id used when saving data in Magento tables.
The store_view_code column from the CSV is not directly converted to store_id. It is used to validate whether the file matches the selected store view.
Example:
store_id = 1,store_view_code corresponding to that store view,store_id = 1.Available modes:
update,insert.update updates existing categories.
insert creates new categories.
CSV file with headers in the first row.
The file should be encoded in UTF-8.
CSV delimiter. It must match the delimiter used in the file.
Defines behavior for columns that are neither system columns nor known category attributes.
Available options:
error - import reports an error for unknown columns.ignore - unknown columns are ignored.Recommended option:
errorDefines how the module interprets empty CSV cells.
Available options:
skip_empty,clear_value,use_default.skip_empty means an empty cell will not change the current value.
clear_value means an empty cell will clear the attribute value.
use_default means an empty cell will remove the store view override and let Magento use the default value.
Recommended option for update imports:
skip_emptyDefines how the url_key attribute is handled.
Available options:
use_csv_value,generate_from_name,keep_existing,magento_default.use_csv_value saves url_key from the CSV.
generate_from_name generates url_key based on the name value.
keep_existing keeps the existing url_key in update mode.
magento_default leaves URL handling to the standard Magento mechanism.
This option defines whether Magento should create a permanent redirect when url_key changes.
It is worth enabling when a category URL change should preserve SEO redirects from old addresses.
Base directory for category image import relative to pub/media.
Default:
import/categoriesFull path in Magento:
pub/media/import/categoriesIf you provide the following in the CSV:
gear/bags.jpgthe module will look for the file at:
pub/media/import/categories/gear/bags.jpgDefines import behavior when errors occur.
Available options:
skip_invalid_rows,stop_on_first_error,all_or_nothing.skip_invalid_rows skips invalid rows and continues the import.
stop_on_first_error stops the import after the first error.
all_or_nothing requires the entire file to be valid; if an error occurs, the import should not save data.
Recommended option for large files:
skip_invalid_rowsNumber of rows processed in a single batch.
Default:
100A lower value reduces memory usage. A higher value may speed up import on stronger environments.
List of attributes to be imported.
Import updates only the selected attributes. If a column exists in the CSV but the attribute is not selected in the form, the module should not save it.
Validation mode without saving data.
It is recommended to run dry-run before the actual import, especially for large files or SEO changes.
update mode is used to update existing categories.
The CSV must contain:
store_view_code,entity_id or category_path,The module tries to find the category by:
entity_id,category_path, if entity_id is empty.entity_id is the best identifier when the import is performed in the same Magento environment.
category_path is more portable between environments, but it must be unique.
store_view_code,entity_id,category_path,name,url_key,meta_title,meta_descriptionpl,13,Default Category/Gear/Bags,Torby,torby,Torby,Torby i akcesoriapl,14,Default Category/Gear/Gloves,Rekawiczki,rekawiczki,Rekawiczki,Rekawiczki sportoweImport settings:
Store View: Polish store view,Import Mode: update,Attributes to Import: name, url_key, meta_title, meta_description,URL Key Strategy: use_csv_value,Empty Values Policy: skip_empty,Dry Run, then the actual import.insert mode is used to create new categories.
The CSV must contain:
store_view_code,category_path,parent_entity_id or parent_path,name,entity_id is not required because Magento assigns it automatically.
store_view_code,parent_entity_id,parent_path,category_path,name,url_key,is_active,include_in_menudefault,12,Default Category/Gear,Default Category/Gear/Helmets,Helmets,helmets,1,1default,12,Default Category/Gear,Default Category/Gear/Gloves,Gloves,gloves,1,1Import settings:
Store View: default store view,Import Mode: insert,Attributes to Import: name, url_key, is_active, include_in_menu,URL Key Strategy: use_csv_value or generate_from_name,Error Policy: skip_invalid_rows,Dry Run.The module supports select and multiselect by option labels.
You do not need to provide technical option IDs.
Example:
store_view_code,entity_id,category_path,display_mode,available_sort_by,default_sort_bydefault,13,Default Category/Gear/Bags,Products only,Position|Product Name|Price,PositionFor multiselect, multiple values are separated with the delimiter:
|If the label does not exist or is ambiguous, the import will report an error.
Before importing images, place the files in the directory:
pub/media/import/categoriesCSV example:
store_view_code,entity_id,category_path,image,thumbnaildefault,13,Default Category/Gear/Bags,gear/bags.jpg,gear/bags-thumb.jpgImport settings:
Images Base Directory: import/categories,image, thumbnail.The module will check whether the files exist and have supported extensions.
After import, the module generates a CSV report.
The report includes:
Statuses may include:
success,error,skipped_no_change,skipped_existing.Import history is available at:
System > Data Transfer > Export/Import Categories > Import HistoryHistory includes:
dry-run,store_view_code matches the target store view.update import.Empty Values Policy to skip_empty.Dry Run.category_path, parent_path, or parent_entity_id.insert import.name and other required attributes.Dry Run.After importing category changes, it is worth refreshing the Magento cache:
bin/magento cache:cleanIf the store requires manual reindexing after larger catalog changes:
bin/magento indexer:reindexIn typical Magento installations, saving categories through standard Magento mechanisms should trigger the appropriate processes associated with the category model, but after large imports it is recommended to check cache and indexes.
Check whether the code in the store_view_code column matches the store view selected in the import form.
Check:
Attributes to Import,Empty Values Policy is not set to skip_empty,Dry Run.Check whether the option label in the CSV exactly matches the option label in Magento for the selected store view.
Check:
pub/media/import/categories,Check parent_entity_id or parent_path. The parent must exist in Magento or appear earlier in the import file.
If the module was installed via Composer:
composer remove kowal/module-export-import-categoriesbin/magento setup:upgradebin/magento cache:flushBefore uninstalling, make sure the import history can be removed. The module creates the table:
kowal_export_import_categories_history