Prestashop logo, Visit home page

I have a problem with CSV file

-

Preparing CSV files

Imported data must be in a text file, using a CSV-based format (Comma-Separated Values) and the accompanying .csv file extension.

We recommend using a semicolon ";" as a field separator. If your text data (product description and such) contains semicolons, you should either remove them, or choose another field separator.

You can create a CSV file using any text editor (we recommend Notepad++: http://notepad-plus-plus.org/), but we do advise you to use a spreadsheet program, then save your work in the CSV format. Using a spreadsheet program enables you to have an easier and more visual grasp of your data, in comparison to the plain text file. You can use Microsoft Excel or the free OpenOffice.org software.

Here is a sample import file, with a list of products:

8.1.1.png

Note that this is only a sample file built for this demonstration; it is deliberately not optimized for PrestaShop import. If you need sample files you can base your own import files on, use the ones you can download from the window that appears when you click the "Upload" button.

The first row should be a descriptive name for the data column (you will be able to skip it during the import process). There must be the same number of columns on each row.

You should remember that:

The price column will use your store's default currency;

Categories are to be specified using their existing IDs (so you should have imported them first), and separated with a comma;

The URL of the images must be an absolute link. In other words, it should be the link that may be used in a web browser in order to display the image. For instance: http://www.myprestashop/images/productXXX.jpg;

The file's character encoding should be UTF-8. If not, use ISO-8859-1 and check the "ISO-8859-1 encoded file" option.

Dates use the ISO 8601 format, without a time zone designator (the time zone is the one for your store): 2013-06-21 15:07:27.

 

Uploading the file

Once you have all your data in CSV format, you can upload them to your store's database using the form on this page.

You have two ways to register files to import:

1. Using your browser: click the "Add file" button, find your file then validate. Do this as many times as necessary to list all your import files.

2. Using your FTP client: upload the files in the /admin-dev/import folder of your PrestaShop installation. Reload the import page: the "Choose from history/FTP" button should now indicate a number. Click the button to display the list of available files (including the ones you previously uploaded using the browser), then click the "Use" button for the file you wish to import.

Once your files are all listed in the "Select your CSV file" section, you can proceed with the rest of the form:

Select the type of data contained in your file, using the dropdown list named "What kind of Entity would you like to import?". Once you have selected the type of data, the list of the available fields appears on the right, which helps you refine your CSV file – at least for the order of the columns, which will soon prove handy.

Select the language of the imported content. If the target language is not available, you must install it first, on the "Localization" page under the "International" menu.

Select the file encoding. Simply indicate if the file uses ISO-8859-1 or not. If not, then it is assumed the files use UTF-8.

Select the field separators. We suggest that you leave the default values ("field separator" with a semicolon, "multiple value separators" with a comma). But obviously, if your CSV file is built differently, you should change these values accordingly.

If you want to remove all the products in your catalog before importing, select the appropriate option.

Once all your choices have been made, click "Next step".

All import files are uploaded directly in the admin folder's /import subfolder. If the CSV File dropdown menu gets too crowded, you can delete old imports directly using your FTP client.

When you click the "Next step" button, the page reloads with the data mapping tool. This interface helps you map your file's data columns with the ones required by PrestaShop.

8.2.1.png

For instance, with the sample file for products:

First column. We marked it as "Enabled", PrestaShop presents "ID" as a header. Click on the header's dropdown menu, and select "Active (0/1)".

Second column. Marked "Name", header indicates "Active (0/1)". Let's change the header for "Name".

Third column. You get the idea.

The screen cannot contain more than c columns, so click the ">" and "<" buttons to see the other columns, and make sure to match them all correctly.

In our example, we used the first row for column names. Since we do not want these imported, enter "1" in the "Rows to skip" text field.

Once you are done matching your columns, click the "Import .CSV data" button (top right of the screen), and PrestaShop will start the import process. When the process is done, you are sent to the main screen, which should either confirm that everything has indeed been imported, or notify you of any problems encountered. In this second case, you should review your CVS file and make sure to correct everything.

Share