07/11/2023 Franck Bugnet Guide

How to choose the categories synchronisation key


This key is essential because it is the key that tells Merlin Backoffice whether to create a new category or choose an existing category to either create or move a product in or to modify an existing category.

Depending on your choice, the columns present and their content, Merlin's behaviour can be completely different.

CASE 1, key set to "Category identifiers". 

If the default "Category Id" column is absent, empty or contains a zero, or a number that does not correspond to any existing category. Merlin interprets this as a request to create a new category (provided you allow it to do so by checking "Create non-existing categories" in step 4) and provide it with a name (in the "Category name or path" column).

The created categories will be created by default in the "Home" category of PrestaShop (it can have a different name), even if a category with the same name already exists somewhere in the structure.

If the "Category name or path" column contains a tree (ex "Clothes>Men"), it will create the two categories Clothes and Men, with Clothes in Home and Men in Clothes.

If the number does not correspond to any existing category, a name is provided, the option "Create non-existing categories" is ticked in step 4 and the option "Force IDs" is also ticked in step 4, then Merlin will create a new category under this name and also assign this number provided as an ID. 

Please note that if the column is absent or empty or contains 0, and "Create non-existing categories" is not ticked in step 4, or you do not provide a category name to create, the product will be created in the default category defined in step 4 as well.

If it contains a number corresponding to an existing category, Merlin will not create a new category, but will create the product in the existing one. It may be possible to change it if, for example, a different name is provided.

If the line is about modifying an existing product and this category number is not the current default category number of the product, Merlin will ignore this number if the "Allow products to move" option is not checked, and will move the product into this category otherwise.

Special case (only from version 1.5.1 of Merlin): if the column "Default category identifier" is absent, empty or contains a 0 and the line corresponding to the modification of an existing product, its default category will not be modified. 

However, if the column "Category name or path" is present and contains a value and the option "Create non-existing categories" is ticked, then a new category or branch (with no product in it) will be created under the Home, with the names indicated in "Category name or path". This is true even if a category with the same name already exists somewhere.

CASE 2, key set to "Category name or path". 

If the column "Category name or path" is present and not empty: Merlin will search if a category with the same name exists in the structure and will use it (the first one found) if so. If the column contains a tree structure such as "Clothing>Men", it will search if there is a Men category, subcategories of another Clothing category. So if there are several categories with the same name as the one you want to assign to the product, you can tell Merlin which one to choose by indicating a more precise path (it is not necessarily necessary to indicate the full path from Home. It is often sufficient to indicate the parent category).

If such a category does not exist, Merlin will be able to create it in the Home page if the "Create non-existing categories" option is checked in step 4. In the case of a tree structure, it will be able to create all the missing links of the tree structure (i.e. several categories of the same branch in a single operation).

If the column "Category name or path" is absent or empty, or if the option "Create non-existing categories" is not ticked in step 4, the product will be created in the default category defined in step 4.

Please note that it is not possible to rename a category or move products when the key is set to "Category name or category tree". 

So if the product already exists there will be no change to its default category.


Category's other articles Import into PrestaShop database

Settings
  • Login
    • £ GBP
    • $ USD
Menu