07/11/2023 Franck Bugnet Video How to

Import of attributes and combinations into PrestaShop

PrestaShop imposes a strict and complex method for importing variations into the catalog. In particular, the requested file format does not correspond to anything standard and is often a source of errors. It is therefore often complicated and time-consuming, if not impossible, to import files as supplied by wholesalers or suppliers into your store, without having to modify them.

With Merlin Backoffice on the contrary, the file requested couldn't be simpler: one column per attribute group, with just the values in the cells. As a result, this declination import module can handle almost any file without reworking it.


Group, attribute, declination, characteristic, category, let's use the same vocabulary



Declined products are products that are available in different references, in different variants or with options. Typically, a garment may be available in various colors and sizes.
These variants or variations are called declinations in PrestaShop stores.

A set of colors is a group of attributes, and the colors themselves are attributes. Some people sometimes use the term "category" instead of group, but this is a source of confusion with product categories.
Another classic error, often made by PrestaShop itself, is to omit the word group and speak only of values.

Creating declinations in a product by import therefore consists of creating the groups if they don't already exist, the attributes themselves, and for each possible combination, a declination, i.e. a set of properties, such as "Size XL and Green".

Variants can have their own weight and price, defined by "weight impact" and "price impact", which are added to the weight and price of the parent product.

To order in the front office, customers are invited to choose the model they want from all the items available in the catalog.

They may also have their own part number, bar code and, of course, their own stock or quantity.
The stock of the parent product is always equal to the sum of the available quantities of each of its different available models.

Do not confuse with features: these do not create product variants, but are associated with the products themselves. Features allow you to give a more precise description of the product, for example by indicating its material or warranty period. This provides additional information for customers. But it does not enable finer management of orders.



Importing declinations with PrestaShop 1.6 or 1.7



Anyone who's dabbled with it will tell you, it's not practical at all. There are several reasons for this:

  • The format of the table requested is specific to PrestaShop. It will therefore often be necessary to modify suppliers' xls or csv files.
  • Beyond a few hundred lines, PrestaShop often crashes.
  • Lack of flexibility, for example there are only two possible choices for identifying products, their identifier or their reference.
  • You can't use a file containing both product lines and variation lines.
  • It's not possible to update items massively by importing a csv/xls because PrestaShop creates new references that will be as many duplicates in the web store.
  • It's lennnnnnt.



The column format



Whether it's an Excel (xls, xlsx), txt or csv file, you need to put everything in two columns, one for the list of groups, a second for the list of values:

  1. Column containing the complete list of attribute groups.
  2. Column listing attributes, in the same order as for groups.


Declination import file template in PrestaShop 1.6 or 1. 7

If it were enough to indicate names and values, but as you can see in this PrestaShop template, you must also indicate:

For groups, their type and position (display order).
The type can be, for example, either "color" for a group of colors, in which case the buyer will choose the color by clicking on a small graphic square of the same color, or "select", for a choice to be made from a drop-down list, or other (checkboxes etc).

For options, in addition to their value, you must indicate their position.

Values, types and positions must be separated by colons (non-modifiable separator).
Multiple properties will be separated by a comma and a space (modifiable separator).

How to import declinations with PrestaShop 1.7?



  1. Go to PrestaShop's advanced settings page.
  2. Click on "Import".
  3. Choose the import type.
  4. Fetch your data file, you can choose between csv, xls, xlsx, xslst, ods, ots (xml).
  5. A useful little helper, the list of fields available for import, such as the list of images to associate.
  6. Link to the template file (the same as the one displayed earlier in this page).
  7. Be sure to indicate the language of the file.
  8. The field separator and in fact the separator between columns for csv files.
  9. The multiple-value field separator is precisely the comma to be inserted in cells between value, type and position.
  10. You can request that existing declinations be deleted. WARNING, this deletes them all, the entire catalog, not just those of updated products!
  11. By default it's the PrestaShop product ID that's used as the key, i.e. used to identify in which product to create the variants. But here you can choose to base the key on part numbers. Too bad you can't use barcodes or supplier references.
  12. By default, the import script will notify you by e-mail when it's finished (when we tell you it's not fast :-) ).
  13. Then move on to the next step, data mapping or matching.


step-by-step import of variations into PrestaShop 1.6 or 1.7

Data correspondence page between file and database



  1. For each column of the table, choose from the list provided the database heading in which to write the data. Fortunately, you don't need to know the structure of the database or the names of the tables.
  2. For the attribute group column, map it to "Attributes". PS isn't very consistent with its own vocabulary.
  3. And for the attributes column, map it to "Value".
  4. You can specify the number of first lines to be ignored.
  5. You can name this data mapping template for re-use later.
  6. Save it.
  7. Run import.



step-by-step import of variations into PrestaShop 1.6 or 1.7, continued


> PrestaShop Merlin Backoffice module?



Extra simple file format



Merlin isn't difficult, it's designed from the outset to adapt to any type of document, making catalog import work much easier. For options, it's much simpler: one column per category, containing just the raw data. These columns can have any name or title, non-empty and unique, and be placed in any order. If the column title is equal to the name of a group, the mapping will be done automatically, as for example with this file containing the data from the PS template, but simplified:

Format attribute columns with the PrestaShop Merlin import module

Frequently asked question: is there a reusable template that can be filled in line by line? No, there's no need for that, as the only rule is to give each column a unique title, so any file will do. However, it's easy to create your own template, simply by exporting one of the existing options from the catalog. Tell the grid configurator which headings to display and export a table row (right-click on the "Grouped actions" button), choosing the format suitable for re-importing with Merlin.



Comparison between the two import methods



The advantages of using this import module are numerous:

  • Unlimited number of lines.
  • No server timeout possible.
  • Exceptional import speed.
  • You're guided step by step in 5 intuitive steps.
  • Read local files or those stored on a server just by indicating their url.
  • Management of non-standard CSV formats, UTF8 encoding management, automatic deletion of quotation marks surrounding data, choice of separators and line breaks...
  • Management of multi-sheet Excel files.
  • Integrated xlsx file editor.
  • Numerous choices of sync keys (Ids, reference, supplier reference, product and category names, ean13, UPC, attribute list).
  • For each column, you can choose whether or not to use it when creating new declinations, and whether or not to use it when updating or modifying declinations.
  • Automatic sorting of single or declined product lines.
  • Possible filtering of lines to be imported.
  • Automatic search and correction of duplicates on any key.
  • Possibility to test the import on a few lines.
  • Sale price calculation based on purchase price to manage margins.
  • Possibility to modify via import the purchase price only if it is cheaper than the current price.
  • Import images with automatic and customizable caption filling.
  • Import virtual columns, dynamically modify column content before import.
  • Import possible in custom fields added to tables.
  • Automatic import scheduler included.
  • Creation of new groups and values possible without importing a single row.
  • Possibility, as in PS, of saving the data correspondence model, but much more than that, all settings are storable in import tasks that can be reused and modified ad infinitum.
  • Automatic management of obsolete products (missing in the supplier file but present in PrestaShop).
  • You can set the import speed yourself according to server performance and network connection.
  • Support for all PS versions from 1.2 to 1.7. Updated and re-tested as soon as a new PrestaShop version is released.
  • Free support and assistance.
  • Remote support for individual training sessions with your own files. You'll never be without a solution.
  • etc



Learn how to import declined items into PrestaShop with the Merlin module (in French).



Through this video, you'll discover how easy it is to import attributes into a PrestaShop store with Merlin, from a file that is nevertheless very complex, as it mixes both products and their variations.
This same file having already been used during the tutorial on importing parent products. If you're not at all familiar with importing under Merlin, we suggest you take a look at this previous tutorial first.

35min

resolution



Import into a store without identifier or reference, only from attribute list



This is a much-requested new feature of version 1.6 of our module for PrestaShop, the ability to choose as synchro key the columns sizes, color,...

What's a sync key? It's the heading or column that Merlin uses to determine whether the item already exists in the product. Its value must be unique for each item. If it exists, it will only be updated; if it doesn't, it can be created. The most common is the PrestaShop identifier, but this is not present in supplier files. Other possibilities are reference, supplier reference, barcodes etc.



PrestaShop only accepts the PrestaShop identifier or reference as a synchro key.
Merlin already went much further, allowing synchronization also through supplier references or ean13 or UPC barcodes (as well as the name for products and categories).
But sometimes, suppliers only have to offer files with no column for identifying variants, apart from their characteristics.

These files are perfectly usable for creating new variants, but not for updating them. Well, that was before, because it's now possible simply by choosing the new "Attributes" option in Merlin, step 3, as the synchro key:

Attribute sync key

How it works: Merlin identifies the parent product as usual thanks to the product sync key, then compares the list of existing variants in this product with the requested one, by comparing their complete lists of properties.


Category's other articles Import into PrestaShop database

Settings
  • Login
    • £ GBP
    • $ USD
Menu