Includes the following actions:
When you import categories to PrestaShop pay attention to each Wizard's page. Import is a rather complicated procedure and it may be destructive if performed incorrectly.
Create database backup before importing PrestaShop categories especially if you do it the first time!
First of all, prepare a .csv file for Import. Make sure it contains all necessary fields and all data you are going to import is listed in the table.
You should have the following data in your file to import as:
category ID or /and category name - at least one of such field should to be in the file to import to be able to use it as an identifier for imported data.
parent category - the category to which the appropriate category is linked
category position - the order of the categories in the category tree
active - the status of the category activity; '1' - active, '0' - inactive
date_add - the period of the category creation
date_upd - the date of the last updates
category description - text, which helps to get more details on the category(ies)
link_rewrite - the end of the URL path(s) of the category(ies) which will be generated for preview category(ies) on the Front-End etc.
1. To start Import/Export you need to click on the button which starts the Import/Export PrestaShop Categories Wizard in the top of Store Manager:
or you can find 'Import/Export Categories' option in the Categories' toolbar:
2. Select "Import" in the PrestaShop Categories Import/Export Wizard and click on the "Next >" button to continue.
Source file preview shows a part of the .csv file selected to import. There are no options to set, but you should pay some attention to this page.
What's so important to look for on this page is fields delimiter and quote character, if some are used.
setup these settings on next page. Usually, it is enough to see the first line, no need to investigate entire file.
Select fields delimiter and quote character page contains some important settings. If you specify wrong values, PrestaShop category import may not work.
The first option is delimiter character. Most popular delimiters are the comma (,), semicolon (;) and tab character ( ) however other symbols can be used as well.
imported.Quote, string values delimiter will be used to separate strings in a .csv file. This delimiter can be disabled if none are used. On previous sample page, we have noticed that comma symbol was used as delimiter and values were quoted with " symbol. Specify two first settings as shown above.
The third setting is PrestaShop category delimiter. This is not native .csv setting, it is used only in Store Manager. As you know categories are organized in a form of tree, where parent category can contain one or more
subcategories, and subcategory can contain one or more other categories. Category delimiter character is used to separate category names and specify full category tree path for given category. Category path is very similar to
directory path used to specify full file name in Windows, where every directory separated by backslash (\) character like this one C:\Program Files\eMagicOne\Store Manager for PrestaShop\.
As for example PrestaShop category path for "Sample Subcategory" (see image below) will be Hardware|Graphics Cards|Sample Subcategory. Pipe (|) character was used as separator.
Images - Default images path is the place where store manager will look for images when importing PrestaShop categories - image names specified in .csv file whereas image files stored here.
When store manager is unable to find an image it will not import image information to a category and will remove existing image information if any.
Parameters on the Base Formats and Separators page are used to convert text values from .csv file to numerical and date values. You can just set default formats with appropriate button.
The next page allows you to Link columns from .csv file to appropriate database fields.
Link columns from .csv file to appropriate database fields. The left pane "Database Fields" shows the list of fields in your database that can receive import data.
The topmost option on this page is First row in .csv file contains field names but not values. Obviously it should be unchecked if first row of .csv file contains data, otherwise check this option.
Next option is Identify categories by. Import will search for PrestaShop category using selected identify method. The category will be modified if found, if not - new category will be added.
Source .csv file can contain multiple records with identical Name values. All these PrestaShop categories will be considered as one - currently imported to PrestaShop categories will overwrite previously imported with the same
key field values. Note that sometimes one of key fields may be blank. Obviously blank fields contain the same value for all records. It is required to assign .csv columns to key fields.
Database Fields contains such columns:
To assign .csv column to database field you should select a field at the left pane and then click a column at the right pane.
[Auto Fill...] button - try to set correspondence automatically for all fields. Will work only if .csv column name is the same as database field name ("translated").
PrestaShop Categories were not imported to your PrestaShop database yet. On Import Preview page you can see how .csv file was processed using import settings, which you specified at previous steps.
Check whether all columns that you want to be imported are filled with data: some of them may be blank. This means that either you haven't assigned .csv column or it is empty in source (.csv) file.
Columns that were not assigned will not be imported whereas empty values will overwrite existing.
You can choose one of import methods.
Attention! Import process will start, when you press "Import" button! If all settings are made correct then continue the procedure, otherwise press "Back" button and check settings once more!
In the last window of PrestaShop Import Categories Wizard will be shown if any errors occurred during import process.
Most frequent import errors are date, time and number conversion issues, caused by improper format settings (specified at previous page) or improperly assigned column (i.e. if you assign column containing PrestaShop category
ID to parent_category database field). Date/time conversion errors might be ignored whereas other errors like this one (Could not find image:image_name.gif) better to be fixed.
The following video tutorial shows the passing of the main import categories' steps in practice:
Here are some related articles on PrestaShop Categories Import: