Create grouped products using the standard product importer
Questions:
- How can I automatically create grouped products?
Description:
The standard product importer not only allows the simple import of products, it also allows the items to be created as group items and thus presented to the user in the form of a variant selection. It is also possible to assign an article to an existing group article.
Basic principles:
Group articles - together with the product data itself - are somewhat more complex to define, which is why there is no reference to the group article function in the standard template. The function is intended for more advanced users.
To automatically create group articles or assign articles to existing group articles, you need so-called JSON data structures. Here are a few words of explanation about JSON:
- JSON basically defines a complex data structure consisting of lists and objects.
- Square brackets define a list, multiple entries are separated by commas: ["Entry 1", "Entry 2",...]
- Curly brackets define a data object. In addition to the object property, a value must also be defined: { "property 1": "value 1", "property 2": "value 2" }
- Data objects can be summarised in a list.
With this prior knowledge, the standard product import can now be used to create group items and assign products to group items.
Solution:
- Add the columns "Group product ID", "Group name", "Group dimensions" and "Group values" to the Excel file
- Enter the ID of the group product in the "Group product ID" column. If it is a new group to be created, enter a combination of letters here, otherwise enter a number. This enables the importer to recognise which items are to be combined in a group. You can create as many groups as you like in an import file.
- Enter a name for the group product. As TYRIOS has a multilingual structure, you must do this for each language. Use the following data structure (JSON data structure):
{"de": "German name", "en": "English name"}.
You only need to take into account the languages that you have activated in the system. The name of the group product appears in the search and in the article overviews.
- If you want to create a new group product, you must define the group dimensions. For existing group products, you can leave the field empty (this also applies if the group product was created in a line previously). Use the following JSON data structure:
[{"name_en": "size", "type": "text"}, {"name_en": "colour", "type": "image"}]
If several languages are to be activated, please enter a name for each language in the pattern "name_[language]". German is a mandatory field. The available types are "text", "dropdown" and "image".
Please note that the dimensions of stock group items cannot be customised via the importer. The definition must therefore match the stock definition exactly. In this case, however, you can also omit the dimension completely, as the group item is already defined.
- Finally, enter the group values. You must take the order of the dimensions into account. The group values must be defined as a JSON data structure:
[{"en": "XS"},{"en": "red"}]
We define the values for two dimensions here. For the first dimension ("size") we define the German value "XS", for the second dimension ("colour") the value "rot". If your system supports multiple languages, please enter a value for each language. German is mandatory.
Tips and Tricks:
- The position of the items and therefore the dimension values corresponds to the import sequence. If you want to control the order of the dimension values - which makes sense for the size, for example - then make sure that the products with the smaller sizes are imported first. It is sufficient if these are listed first in the import file.
- If a group value combination already exists, the product standard importer cannot import the item as the value combination must be unique.