In many cases, especially when migrating products from other Opensource platforms a shop owner might need an option that will allow the bulk export/import of products since doing it manually product by product is severely time-consuming. In this context, the major E-Commerce platforms have adopted the usage of common file type which allows the storage of multiple products separated by a certain delimiter. This file format is called CSV and in the next steps of this tutorial, we will show you how to properly utilize the bulk import functionality of Prestashop.
A comma-separated values (CSV) file is a text file that uses commas to separate values. A CSV file stores data like numbers and text in plain text. Each line of the CSV file is a data record. The use of the comma as a field separator is the source of the name for this file format. The term CSV also denotes some closely related delimiter-separated formats that use different field delimiters such as semicolons. They include tab and space-separated values. These alternate delimiter-separated files are often even given a .csv extension despite the use of a non-comma field separator. This loose terminology can cause problems in data exchange. Many applications that accept CSV files have options to select the delimiter character and the quotation character.
To be able to bulk import products using CSV file you will first have to access the “Import” page of Prestashop. To do that you have to login to the PrestaShop admin area and from the left vertical navigation menu look for the “Advanced Parameters” option. Once you find it, please, click on it. A drop-down menu will appear with the options “Information”, “Performance”, “Administration”, “Import” and so on.
From the drop-down menu, please, click on the “Import” link to access the “Import” page.
There, you will be presented with all the sections that need to be filled out in order for you to actually import products from CSV files.
The “Import” page is divided into three sections. The biggest one is positioned on the left side of the page and it is called “Import”.
In that section, you are presented with all the steps you have to set as primary settings for the import of a product with CSV files. You will learn more about it in the next step.
Next, is the “Available fields” section. You will find that on the top right side of the page.
As the name suggests that section contains all of the available fields, such as:
Please, bear in mind, that the content of the Available Fields section will vary depending on the fields that the CSV file has.
Although the importing tool helps you by taking care of matching the CSV file's fields with the ones in PrestaShop, it is good if you strive to make your data more import-friendly by following the naming scheme and order of the presented fields. Otherwise, the import will be harder to achieve, but not impossible. Please, pay attention, that some fields have a little information popup available (represented by a "?" sign), which you can browse by clicking on it.
They are mostly connected to PrestaShop’s multistore functionalities or advanced stock management feature. Please, make sure you read them all in order to better build/edit your data files.
There are “Sample CSV” files provided by PrestaShop. They are stored in the “Download sample CSV files” section.
In that section, you can find sample downloadable files for:
By clicking the file itself, you will download it on your computer. If you are curious and open that file, typically, with some table management software like Excel, for example, you will notice how all the information is conveniently structured in a table view.
You will notice that the columns in the table view are the same as the displayed in the “Available fields”.
Now, let’s head to the actual process of importing products using the .CSV files. It requires preparation and starts with a form for the primary settings:
The "Available fields" on the right updates when you choose an entity. This way you know the kind of data that your import file should contain. PrestaShop gives you the option to choose the following types of data for import:
Since in this tutorial we are aiming to import products, let’s choose the Products option.
You can either upload files from your computer or choose files already available on your FTP or in the history section of Prestashop. Please, bear in mind, that all allowed formats are the following: .csv, .xls, .xlsx, .xlst, .ods, .ots. Only UTF-8 and ISO 8859-1 encodings are allowed.
You can also download sample files for each type of data from the "Download sample CSV files" section on the right. Doing that helps you to compare the sample files with your own files. This way you can make sure that the files you are about to import are actually ready to be imported to your PrestaShop Online Store. These files are actually stored in the /docs/csv_import folder of your PrestaShop installation.
The next option in the “Import” section is about the languages that the files are on.
Once you have filled out all your products in the CSV file, you can upload them to your Online Store using the “Select a file to import” option on the “Import” page. When the file is uploaded and you are done configuring the basic options for importing a product using the CSV file, please click the “Next step” button at the bottom of the page.
Please, bear in mind, that all import files are uploaded directly in the admin folder's /import sub-folder. If the file drop-down menu gets way too big, you can delete old imports directly using your FTP client.
When you click the "Next step" button, you will be redirected to a page with the data matching tool.
On that page, you can actually match your file’s data columns with the ones required by PrestaShop. In a structured table view, you will be presented with all the columns added in the data file that you created. They will be placed under the arbitrary columns matched to PrestaShop’s database needs.
It is up to you to make sure that all the columns from your CSV file match the correct column header. You can do that by using each header’s drop-down selector, in order to import your content correctly.
For example, let’s use the sample file.
Since that column does not match the PrestaShop requirements for importing CSV file you will have to click on the header’s drop-down menu and select “Active (0/1)”. That way you will indicate if you want that column to be skipped by PrestaShop or no. In order to skip the text-field, please, enter 1 in the “Rows to skip”.
When you set these 6 columns that you are presented with on the screen, please, click the “>” and “<” buttons at the bottom of the page to see the other columns. Please, make sure you match the columns correctly.
After you are done matching your columns with the PrestaShop ones, click the “Import” button at the right bottom of the page.
When you click the “Import” button PrestaShop will start the importing process. A pop-up window will appear to show you the progress of the import. If your file is matched properly then once the process is done, you should see “100% validated and 100% imported” label. By closing that pop-up window you will be redirected to the main screen. If there is an error that occurs during the import you will be presented with a notice of all the encountered issues. If that is the case you should review your file and make sure to correct everything.
The matching process can be a tedious task if you cannot customize your file columns order according to that used by the PrestaShop importer, and even more so if you have to do that repeatedly or frequently. For that PrestaShop includes a small field that allows you to save the current matching configuration.
The tool is a simple field at the top of the matching tool. Please, bear in mind, that if there is no matching configuration saved yet there will be only one field, but if you had already saved the configuration then three fields with basic actions will appear. They are as follow:
Managing products by using CSV files is recommended, even though you may find it is not that easy at the beginning, as the time goes by, you will find that using CSV files to manage product information is saving a lot more time.
Congratulations! Today you learned what is the meaning of a CSV file, why it is good to use it and how to manage the products in your Online Store with such type of files.
Simeon is an experienced System Administrator with over 10 years of experience in the Web Hosting field. making him recognized as the man behind every technical innovation or improvement that HostArmada introduces. Agile and responsible, he solves every technical issue that we throw at him and even often you will find him publishing technical content on our website.