Updating combinations in bulk

The import rules

The CSV import tool within your Store Commander is also design to let you update combination information.

But first and foremost, there are some configuration rules to apply when importing.

The most important configuration point: the identifier

The most important point when importing is the identifier, which is used to find the combination to update.

There are multiple identifiers available in the drop down menu (in the import window), such as reference, ean13, upc and even the combination ID (id_product_attribute).

This identifier is a key point, as it must be unique if the import process is to modify the correct combination.

If you choose the reference, then each combination (and product) must have its own reference. Avoid duplicates!
In the case of duplicates, the import will modify the first reference found in your database, i.e. on the basis of the combination ID.
It is therefore likely that the combination which stock has been modified is not the one you wanted to update.

Same thing if you use ean13 or upc.

We strongly recommend using the id_product_attribute (combination ID) ; no duplicate possible in your PrestaShop database 😉

To identify possible duplicated reference, ean13 or upc on your shop, run the corresponding control of FixMyPrestaShop, accessible in Tools menu of your Sc interface.

More detailed information on this article.

The second part of the configuration: choosing the actions

This tutorial is about modifying combination, therefore the actions to choose will always be skip + modify

Information to modify: the mapping

The section called ‘mapping’ allows you to first choose the identifier selected for your import, as well as the information you want this import to modify.

All fields mapped and ticked will be taken into account during the import.

Taking the example of updating stock on combinations, the field to use is ‘quantity’:

Importing the data

The very last step is to adapt the number of lines to import in the ‘Process’ panel.

500 is set by default:
- if your file contains less than 500 lines, you can keep 500.
- if your file contains more than 500 lines, modify the value
Do note that it’s not necessary to enter the exact number of line, as long as it’s above, it’s fine.

And finally, start your import by clicking on the corresponding icon:

What information can be modified on combinations?

All information associated to your combinations can be updated via a csv import. These fields are/

  • reference

  • ean13

  • upc

  • supplier

  • supplier reference

  • quantity

  • stock location

  • price

  • weight

  • images

  • specific prices: you can refer to this article for detailed information.

By following the rules explained above, your import will include your unique ID + any other fields you wish to modify.

This article is dedicated to stock update, and this other article is about price update.

Only the attributes that make up your combinations cannot be modified during import.

To modify or replace attributes on existing combinations, please refer to this section.

Modifying or replacing attributes on existing combinations

You can modify the attribute of an existing combination (red with dark red) manually in the combination grid, but this action is not possible via csv import.
If you need to apply this modification in bulk via import, the solution is to delete the existing combinations, to then create the new ones with all requested attributes. This procedure will be applied using a single import file.

To keep the current information, such as prices, references, etc, the first step is to run a csv export that will include the following fields:

  • id_product: the import identifier

  • product name: to verify the product name in the file

  • combination attribute + accompanied by the group name (colour, size, etc)

  • reference

  • ean13

  • supplier reference: if used

  • upc: if used

  • mpn: if used

  • quantity

  • stock location: if used

  • price excl. tax

  • images: links_to_all: all images associated to combinations

Add as many ‘combination attributes’ as you need to export all groups used on your combinations.

Once the file generated, you need to add insert a column at the very beginning of the file (column A), called 'delete combinations'.
The value 1 (meaning yes) will be used in that column, to delete all combinations associated to the product on that line.
But be careful to add the deleting value 1 only on the first instance of each product.

The order of the columns is crucial. The deletion needs to occur before adding the new combinations, therefore the column 'delete combinations' has to be placed before the column containing the new attribute values.

The delete action in the mapping will be:

When you start this import, existing combinations (of the products listed in the file) will be deleted, and the new combinations specified in the same file will be created.

💡 Identifying and fixing combinations with missing ean13

With Store Commander, you can easily obtain the list of all combinations that don’t have a ean13 associated, and add them thereafter. This can be done using both csv export and csv import tools.

The first step is to export the information.

Open the CSV export tool from the Catalog menu, and create the script.

Add the following fields to your mapping:

  • id_product_attribute: combination id that will be used as the import identifier

  • name with attribute: to see the combination belonging the the id_product_attribute

  • ean13 + combination value selected in the Options2 column

Still on the ean13 line, enter the following formula in the Modifications column - this is used as a filter, to export only combination without an ean13

 =(empty('(x)')?'(x)':'"_DONOTEXPORT_"')

The file will then have the list of all combination (IDs) with no ean13 in the corresponding column.

You can now add the ean13 on each line of that file, and once done, you can import that file to apply the new ean13 to the combinations - based on their ID (id_product_attribute).

NOTE: don’t forget to convert the format of the ean13 column as Excel converts it by default

The import configuration should be like this: