4. Import Categories
This section describes how to perform category import to CubeCart from .csv file - bulk update CubeCart categories.
It's highly recommended to create Database backup before CubeCart category import, especially if you do it for the first time. Import may be destructive if performed incorrectly.
To import CubeCart categories follow few steps:
- The first thing you need to do is to check/create your .csv file and to get it ready for import. Make sure it contains all necessary fields and all data you are going to import is listed in the table.
- If your vendor provides you categories list in Excel, you can convert your Excel files to the CSV format using Microsoft Excel or OpenOffice application -> Save As option. It allows you to save the file using alternative file formats. Among the file extensions offered, you can find Text CSV file format. By saving your file into CSV format, Microsoft Excel or OpenOffice will export the first active worksheet with the correct delimiters.
- Once you have your CSV file ready for import start Store Manager, open Categories Import/Export wizard and select Import.
- Select the .csv file using browse button [...] or type file path and name.
- You can also load import settings saved on the last step of import wizard used to import a file with similar formatting, column names etc.
- On the next step, Source file preview, you can see a part of csv file selected for import. Here you need to check whether the first line of your file contains field names or data. Also you need to check field delimiter character and whether text values are quoted. Some files may have text enclosed in quotes, while numeric values may be unquoted.
- There's no need to go through all the document, just skim few first lines. In our case first line contains field names, semicolum (;) is used as fields delimiter and text values are enclosed in double-quotes ("). Just keep it in mind for later on.
- Also you may want to start import from any specific line, simply enable the Start Import from row option and specify the line number.
- Select fields delimiter and quote character. If you specify wrong values, file will not be parsed properly and categories will not be imported.
- Delimiter Character. Most popular delimiters are comma (,), semicolon (;) and tab character ( ) however other symbols may be used as well.
- Note. CSV file contains data in row-column format and delimiter character is used to separate one column from another. If you specify incorrect delimiter, file will not be parsed properly and categories will not be imported.
- Quote string values delimiter will be used to separate strings in .csv file. This delimiter can be disabled if none are used.
- On previous sample page we have noticed that semicolon symbol was used as delimiter and values were quoted with " symbol.Specify two first settings as shown above.
- 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 a specific 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 CubeCart\.
- Create import log file feature allows you to create detailed import log.
- Import images. You have to enable the import images feature in order to import images and upload them via ftp. Also to upload images from your hard drive while import, specify image directory with images. Note that you should configure FTP connection in Preferences -> FTP tab to be able to upload images to your server.
- Update database even if image is not found feature allows you to update database fields without uploading images to your server.
- Base Formats and Separators used to convert text values from .csv file to numerical and date values. You can set default values here and proceed.
- The next page allows you to Link columns from .csv file to appropriate database fields.
- Specify the following options:
- 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.
- Category Identification Method - Import will search for a category using selected method of identification. The category will be modified if found, if not - new category will be added.
- Note: It is recommended to use Category name to identify your categories. In case you use export feature to generate the file, you may import items into the same store using any identification method.
- Link columns from .csv file to appropriate database fields. Database fields pane shows the list of fields in your database that can receive import data. It is required to assign csv columns to key fields. 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. Unassigned fields are marked in red. You can use [Auto Fill] option to set correspondence automatically for all fields. This option will work only if csv column name is the same as database field name. Also you can unassign all fields automatically using [Clear] button.
- Database Fields:
- Rec ID - contains database field ID.
- Field - contains database field name. Some values in this column contain actual field name, whereas other are "translated". Anyway these names are clear enough to figure out how to use them.
- csv col # - the number of the column in .csv file corresponding to this field - the link between database field and .csv column.
- Set Null - indicates that this field should not contain any data but should be set to Null. You can either specify column name or check this option, but not both of them at the same time.
- External - used to import external files to your store. If you have local images path like C:\Temp\images\image_1.jpg specified in your .csv file or your vendor provides you an external image or description path like http://www.yourvendorswebsite.com/images/sample_image.jpg you may upload it to your site using external check-box.
- Update - used to set some default value to the field, similar to Set Null, but in this case some value can be assigned to the field.
- Default value - enter the value assigned to a field (is used only if "Update" option is enabled).
- On import preview page you can see how csv file was processed using import settings specified at previous steps. Columns that were not assigned will not be imported and those fields that do not have csv columns linked to them will not be changed. Pay attention to red blinking arrow which will point the errors if there any.
- Save Import Configuration. All import settings can be saved under some configuration. You can load it next time you decide to import categories from a file with similar formatting, column names etc.
- Attention! Import process will start, when you press "Import" Button! Proceed only if all settings are made, otherwise press "Back" Button and check settings once more!
- On the last step of import wizard you can see if any errors occurred while import.
- Also you can save import settings into file using Settings button in order to use them further.
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 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.
Now category import to CubeCart is finished.