Skip to content
Stone & Water
Use Case

Import Shopware 6 variants: via CSV with parent product and options

Creating variants by file is a common hurdle in Shopware 6: the import needs IDs, options must already exist, and in the end variants hang on the wrong product. In the PIM product numbers and readable options are enough.

4 min readFor Shopware 6.6 and 6.7

What the PIM does here
  • Parent by product number: the parentProductNumber column links each variant to its parent, no UUIDs needed.
  • Options in plain text: variantOptions in the format Colour:Red|Size:XL.
  • Missing options are created automatically by the import, as long as the permission "Create properties and options" allows it.
  • Preview and undo: number of new and changed variants beforehand, "Undo last import" afterwards.

What the file looks like

One variant per row. The parent is a row of its own above it or already exists in the shop.

productNumber;parentProductNumber;variantOptions;price_gross;stock
SHIRT-100;;;24.90;0
SHIRT-100-RED-M;SHIRT-100;Colour:Red|Size:M;24.90;12
SHIRT-100-RED-L;SHIRT-100;Colour:Red|Size:L;24.90;8
SHIRT-100-BLU-M;SHIRT-100;Colour:Blue|Size:M;26.90;5

If you leave a variant's price empty, it inherits the parent's price. The quickest way to a sample file is an export with the "Variants" profile.

How it runs in the PIM

  1. Choose the file, CSV or Excel, by upload or URL.
  2. Map the columns and save them as an import profile.
  3. Mode: "Update + new" creates new variants and changes existing ones.
  4. Check the preview: warnings about duplicate product numbers or rows without a number.
  5. Import and look in the change log at what happened.

Often faster: the variant generator

If the variants come from properties, say 6 colours and 8 sizes, the variant generator is faster than a file. It creates all combinations with patterns for product number and name, for one product or in bulk editing for many products. The file remains the right way when numbers and prices come from the supplier.

Example: supplier list with colour and size

Many suppliers deliver colour and size in separate columns. You build the variantOptions column in Excel with a formula, for example with colour in column C and size in column D:

="Colour:"&C2&"|Size:"&D2
  1. Fill the formula down and paste the column as values.
  2. Enter the parent number in parentProductNumber, for example from the supplier's model number.
  3. Import one model first, check it in the shop, then the whole list.

Frequently asked questions

Do I need IDs to import variants?

No. In the PIM the parentProductNumber column links a variant to its parent by product number.

Are missing property options created?

Yes, automatically. If the permission "Create properties and options" is off for regular users, the import does not create missing groups and options.

How do I specify several options?

In the variantOptions column in the format Group:Option, several pairs separated by a vertical bar, for example Colour:Red|Size:XL.

Do imported variants inherit from the parent?

Yes, all fields you leave empty. Fields with their own value apply to the variant only.

Are existing variants updated?

Yes, in "Update + new" mode existing variants are updated via their product number and missing ones are created.

How do I set a price of its own per variant?

Via the price columns in the variant's row, such as price_gross. Left empty, the variant inherits the parent's price.

Further reading