📣🚀🐣🌼 Sonic Bloom - Spring Sale! | Exclusive offers for Cloud Shared Hosting - 70% OFF | Starting from $3.99/mo
Learn Prestashop 1.7

Prestashop is lightweight, SEO friendly E-Commerce platform for large Online Stores!

• Last Updated: 01/03/2020
• ( 17 minutes reading )

How to bulk import products using CSV

Introduction

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.

 

Technical Explanation of the CSV file format

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.

 

Step 1: Accessing the Import page

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.

 

Accessing the Import page of Prestashop

 

From the drop-down menu, please, click on the “Import” link to access the “Import” page.

 

Step 2: Structure of 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.

 

Structure of the Import page

 

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”.

 

Import section of the Import page


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.

 

The Available fields section of the Import page

 

As the name suggests that section contains all of the available fields, such as:

  • ID
  • Active (0/1)
  • Name
  • Parent category
  • Root category (0/1)” and so on.

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.

 

Additional information on the available fields in the CSV

 

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.

 

Sample CSV files

 

In that section, you can find sample downloadable files for:

  • "Categories"
  • "Products"
  • "Combinations"
  • "Customers" and so on.

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.

 

Open the Sample CSV in Excel

 

You will notice that the columns in the table view are the same as the displayed in the “Available fields”.

 

Step 3: Utilizing the “Import” section on the “Import” page

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:

 

  • What do you want to import” - In that section, there is a drop-down menu. Choose from it what kind of entity you would like to import to your shop.

 

Choose what to import from the CSV


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:

  • Categories
  • Products
  • Combinations
  • Customers
  • Addresses
  • Brands
  • Suppliers
  • Aliases
  • Supply orders” (if Advanced Stock Management is enabled)
  • Supply order details” (if Advanced Stock Management is enabled)
  • Store contacts

Since in this tutorial we are aiming to import products, let’s choose the Products option.

 

Choose to import only products from the CSV

 

  • Select a file to import” - You can import more than one file at a time, but make sure that they all contain the same type of data.

 

Select a file to import


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.

  • Language of the file” - Data can only be imported for a single language at a time. If your data exists in more than one language, you should split it into multiple CSV files.
  • Field separator” - Not all CSV files use commas to separate their values: some use tabulations, other semicolons, etc. You can indicate how the products in your CSV file are separated in this field.
  • Multiple value separator” - When an attribute can support more than one value, these values need to be separated with a specific separator. Once you review your files, please, indicated the separator in the field.
  • Delete all products before import” - With that option, you can choose if you want to delete all the existing products and start with a clean state. If the entries of the type of data you are importing are different than products, like for example, you are importing categories, then that field will be called “Delete all categories before import”.
  • Use product reference as key” - That field appears for product import only. You can choose to have the product key to be determined by PrestaShop, or instead, use the product's reference as the ID. In this case, make sure the file does contain references for all your imported products.
  • Skip thumbnails regeneration” - That field is available for a category and product import only. You can choose to have PrestaShop regenerate the thumbnails that are linked from your CSV file (in the "Image URL" or "Image URLs" fields). Please, bear in mind, that disabling the “Skip thumbnails regeneration” option when importing products will make PrestaShop generate thumbnails and that can take a lot of time, which may cause time-out in the importation script.
  • Force all ID numbers” - You can either keep the imported IDs or let the importer auto-increment them. Please, bear in mind, that enabling this option will keep your imported items’ ID number as they are. If you choose to disable this option, the imported ID numbers will be ignored, and PrestaShop will instead create auto-incremented ID numbers for all the imported items. If you get an error while importing, just enable the “Force all ID numbers” option. If you use reference as key, you need to enable the “Use product reference as key” option too.
  • Send notification email” - If you are importing large files, activate this option to receive an email when the import is complete.

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.

 

The Next Step of the Import Process

 

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.

 

Match your data in the CSV

 

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.

 

Match the columns in a CSV import

 

For example, let’s use the sample file.

 

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

 

Choosing Active column


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”.

 

Configure rows to skip

 

  • Second column” - Marked "Name", the header indicates "Active (0/1)". Let's change the header for "Name *" and so on.

 

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.

 

Navigate through the columns

 

After you are done matching your columns with the PrestaShop ones, click the “Import” button at the right bottom of the page.

 

Starting the Import process

 

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.

 

Save your current matching configuration for the CSV import procedure


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:

  • Saving” - Enter a descriptive name in the field, and click "Save". The interface updates to feature the saved configuration in its drop-down list.
  • Loading” - Select a matching configuration in the drop-down list, and click "Load".
  • Deleting” - Select a matching configuration in the drop-down list, and click "Delete".

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
System Administration & Network Operations Captain

Simeon is an experienced System Administrator with over 10 years of experience in the Web Hosting field. He is recognized unanimously as the man behind every technical innovation or improvement that HostArmada introduces. Adaptable and responsible, he solves every technical issue that we or our clients throw at him. Every so often you will find him publishing technical content on our website.