Combine product variants into one parent item with the Merge Variants data service
Merge Variants data service: Merge all product variants into one parent item using the Merge Variants data service in Productsup.
The Merge Variants data service lets you combine all attribute values of all product variants with the same ID into one item. Alternatively, you can use any attribute other than an ID as a basis to merge your product variants.
Note
The Merge Variants data service is available for the import stage only.
For example, if you have product variants in your data feed, it may look similar to this:
product_id | variant_id | size | color | discount_code |
---|---|---|---|---|
1 | 1-1 | XS | green | |
1 | 1-2 | S | green | SALE20 |
1 | 1-3 | L | blue | |
2 | 2-1 | XS | red | |
2 | 2-2 | M | yellow |
You can merge all product variants with the same value in the product_id attribute. This means that, instead of several product variants with the same product ID, you create one item in your feed and combine attribute values for all relevant product variants. After applying the Merge Variants data service, your feed can look as follows:
product_id | variant_id | size | color | discount_code |
---|---|---|---|---|
1 |
|
|
|
|
2 |
|
|
|
|
Note
This example illustrates removing duplicate values for each merged attribute. You can also keep them in your merged values.
Prerequisites
To set up the Merge Variants data service, you need:
A product identifier. See Set a product identifier for more information.
Add the Merge Variants data service
Go to Data Services from your site's main menu and select Add Service.
Search for Merge Variants, select Add, and rename the data service as desired.
Select Add to go to the data service setup page:
Select Add Merge Column to open a pop-up window.
In the drop-down menu Source Columns, select the import-stage attribute that should be the basis for merging your product variants.
In Source Columns, you can't choose an attribute if 100% of its values are empty. If you do so and try to save the data service setup, the platform shows an error and prompts you to change your attribute selection:
In Delimeter, select the delimiter that should separate your combined values in the merged attributes. If you don't select a delimiter, the platform merges values without separating them with any characters.
Select Add to close the pop-up window and return to the data service setup page.
If you don't want to display duplicate values in the merged attributes, leave Concat unique checked. Uncheck this box to keep duplicates in the merged attributes.
For the platform to process the new data service, select Import in the top-right corner of your site's view.
Edit the Merge Variants data service
Go to Data Services from your site's main menu.
Change the settings of the needed data service:
To deactivate a data service, choose the pause icon next to the desired data service.
Select the cogwheel icon (⚙) next to the desired data service to edit other settings.
Delete the Merge Variants data service
Go to Data Services from your site's main menu.
Tip
To stop a data service from affecting your feed without deleting the data service itself, you can choose the pause icon next to the desired data service.
Select the cogwheel icon (⚙) next to the desired data service.
In the Danger Area panel, select Remove this service.
Select Yes.