< Back
Print

Export variant products

CONTENTSERV configuration

Shopware handles variants the following way:
There is one product which we will call the variant head and several sub-products which we will call variants.

How to create a complex product.
For the sake of this manual, we are gonna use some of CONTENTSERVs sample products to demonstrate the process.

In our example Valdipino poncho would be the variant head, Red, Mango, Blue, and lemon would be categories that are just being used to utilize CONTENTSERVs inheritance. We are not gonna export those. The 20 other products would all be variants of Valdipino poncho.

Add the Shopware Variant class to your variant head.

Use the List view and search function to add all variants to the variant head.

The variants should now appear in the SC::Complex article table of Valdipino poncho.

Select your variant attributes in the Shopware Variant attributes field below.

Add the product to a category via the SC::Channel table.

Datamap configuration

 

Enable the row “variants” in your product-configuration.

Click the cogwheel and you will be greeted by a message which tells you which variant options are not available right now.

First, you will have to choose a variant selector. This CONTENTSERV attribute should be available for all variant head products. It is used to confirm which of you Shopware properties is used to create the variant. For example, this is a color variant. Or this is a size variant. This product value (the variant selector) will now be mapped via the Shopware VIx values, which we already encountered earlier.

Click the link to get to the Shopwsare VIx value mapping for variant properties.


We in the section above we choose “Farbwert” and “Size”. So we are gonna map those.

Go back to the “SC::Shopware – Add variants”  dialog. You will notice, rows for color and size have appeared.

Select the “Shopware Varianten Attribute” as the variant creating attribute.

Now look up your variants and determine which attributes contain the color and size values.

Okay for our size its easy enough. But we have two options for our color. A color code and a color text. We are gonna explore both options, but for now, we are using the text attribute. Select both attributes in your configuration.

For each target row, that’s not variantId, click on the cogwheel and again click the cogwheel for the id row.  Select Object type Property.

By default, only the first variant will be listed in Shopware. The rest of your variants can be accessed via the variant selector when you select that product. If you want for example all colors to be listed, you could enable this in the next section “Variants count as articles on their own”.

Save your configuration.

There is another datamap section we have not to touch yet. It’s from the type “upsertproduct” but its name is “Varianten anlegen”
This section controls the values for each variant. For example, what the variant head product is, or which values are different.
All fields which are not mapped here will be taken from the variant head.

 

Run your Job.

All 20 variants will be loaded into the export via the variant head. Check if any errors occurred and enjoy your variant.

Earlier we talked about using color codes. You can achieve this by changing your Shopware 6 color properties Value Type display.

Choose color.

Navigate to your SAWS variants row and enter the configuration.

Change the sub configuration for color to your hex-code color CONTENTSERV attribute, and enter the sub configurations configuration by clicking the cogwheel again.

Add the field colorHexCode and save.

Run the export again and check your result.

You may also use images as variant displays, in that case, don’t use colorHexCode use mediaId similar to when you would export a product cover. The image file has to have been uploaded to Shopware beforehand.

Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents