Rule: Merging Variants#

This rule is designed for converting multiple standalone products, typically product variants, which form a group of items in the input feed linked (most commonly) by the ITEMGROUP_ID element. The rule allows you to consolidate product variants under a single main item (the so-called Master product), simplifying the feed and ensuring correct product presentation on e-commerce platforms or marketing tools.

Extra features#

  • Selection of shared elements (only for selected formats)
  • Left side prefill
  • Option to add multiple rows
  • The rule is available only for selected formats
    • Shoptet Complete and Supplier
    • Upgates Products
    • Woocommerce CSV
    • Shopify CSV
    • Samba.ai

Practical examples#

Example 1: Merging variant products from a Heureka feed for Shoptet#

1. Creating a new rule:

  • Open the “Rules” page.
  • Click the New rule button.

2. Selecting the rule type:

  • In the Rule type field, select the Merging Variants option.

3. Element for selecting the Master item:

  • This field defines the element used to select the main (so-called Master) item.
  • Master item is the one under which all other variants will be grouped.
  • The system looks for the item that matches the logic of the chosen element – e.g., for ITEM_ID, the item with the lowest ID is used as the main one.
  • In our case, we will use: ITEM_ID.
  • 💡 Tip: The Master item represents the product that will be visible as the main product after merging. The other variants remain attached but are no longer listed individually.

4. Element with the grouping code:

  • This element determines how variants are identified as belonging together.
  • The element must contain the same value for all variants of one product.
  • The most commonly used element is ITEMGROUP_ID.
  • In our case, we will use: ITEMGROUP_ID.
  • 💡 Tip: The code in the grouping element must be identical for all variants of one product. For example, all variants of a T-shirt in different sizes (S, M, L) will have the same ITEMGROUP_ID.

5. Parameters forming the product variant:

  • In the Selectbox field Parameters forming the product variant, select all parameters that define the product variants, e.g., Color, Size, etc.
    • 💡Tip: The field is multiselect, so you can select multiple parameters.

6. Maximum number of parameters forming the variant:

  • In the Selectbox field Maximum number of parameters forming the variant, choose how many parameters will define the variant, e.g., 2.

7. Selection of shared elements:

  • In the “Advanced settings” section, select elements that are common to all variants of the given product.
  • These elements will be written only to the main (Master) item after merging, while the variants will no longer repeat them.
    • For example: CATEGORYTEXT, DESCRIPTION, IMGURL
  • In the “Element” field (left column), select from the Selectbox the element you want to set as shared for all variants.
    • To add more elements, add new rows.
  • In the “Action type” field (right column), determine how Mergado should handle different values during merging:
    • Take from Master item
      • Only the value from the main item is used; other values are discarded.
        • Example: CATEGORYTEXT or DESCRIPTION, because the values are the same for all variants.
    • Merge values and remove duplicates
      • Mergado takes all unique values of the selected element and merges them into a list.
        • Example: IMGURL, because variants may have different image URLs and you want to keep all of them.
  • 💡Tip: This section is available only for merging variants in XML feeds (Shoptet, Upgates, Samba AI).
  • 💡Tip: Mergado selects the elements automatically; you only need to review the settings.

8. Naming the rule:

  • In the last step, enter the rule name, for example “Merge variants”.

FAQ#

What is the Merging Variants rule for?#

The rule allows you to consolidate multiple product variants into a single main product (the so-called Master product). It is primarily used when variants in the feed (e.g., different colors, sizes, or dimensions) appear as standalone products and need to be grouped under a single product.

Which formats is the rule available for?#

The rule can only be used for selected formats that support working with variants:

  • Shoptet (Complete and Supplier feed)
  • Upgates Products
  • WooCommerce CSV
  • Shopify CSV
  • Samba.ai

If you need support for another format, write to us at mergado@mergado.cz

What does the “Master item” element mean and how is it determined?#

The Master item is the main product under which all variants are grouped. In the Element for selecting the Master item field, you choose the element (e.g., ITEM_ID) used to determine which variant will be the main one. Typically, the item with the lowest ID or the first occurrence in the feed is selected.

What is the element with the grouping code for?#

This element (most commonly ITEMGROUP_ID) determines which products belong to the same variant group. All variants of one product must have the same code in this element – e.g., a T-shirt in sizes S, M, L will have the same ITEMGROUP_ID.

What happens if some products do not have an ITEMGROUP_ID?#

Such products will not be merged because Mergado cannot identify which items belong together. It is recommended to check beforehand that the ITEMGROUP_ID element exists and contains values for all variants.

How do I set the parameters that form the product variant?#

In the “Parameters forming the product variant” field, select all attributes by which variants differ – e.g., Color, Size, Material. The field supports multiselect, so you can select multiple parameters at once.

What is “Maximum number of parameters forming the variant” for?#

It determines how many parameters will be taken into account when grouping variants. E.g., if variants have two properties (color and size), set the value to 2. This ensures Mergado correctly groups parameter combinations.

What does the “Selection of shared elements” section do?#

It is used to specify elements that are the same for all variants and should be kept only in the Master product. E.g., CATEGORYTEXT, DESCRIPTION, or BRAND. These values are saved only in the main product so they are not unnecessarily repeated for each variant.

What is the difference between “Take from Master item” and “Merge values and remove duplicates”?#

  • Take from Master item: only the value from the main product is used (others are ignored). Typically used for texts or categories.
  • Merge values and remove duplicates: combines all unique values from all variants, e.g., images (IMGURL).

Can the rule be used for products without variants?#

Yes, but it has no effect – products without a grouping code (ITEMGROUP_ID) remain unchanged. The rule is applied only to items that meet the shared code condition.

What happens if variants have different values in an element that should be shared?#

It depends on the selected action:

  • If “Take from Master item” is chosen, Mergado keeps only the Master product’s value.
  • If “Merge values and remove duplicates” is chosen, Mergado combines all values into a single list and removes duplicates.

How do I check if the variant merging was done correctly?#

After saving and applying the rules or regenerating the feed:

  • Open the output feed and check that products were correctly grouped under one Master product.

Can the rule be used to merge variant images?#

Yes. Using the “Merge values and remove duplicates” setting, you can combine image URLs from all variants into a single IMGURL element. This ensures the main product has all relevant images.

What should I do if variants are not matched correctly?#

Check that:

  • all variants have the same ITEMGROUP_ID,
  • variant parameters are filled in and match the feed values,
  • the Master item element is not incorrectly configured in the rule.

💡 If the problem persists, try creating a test project with a smaller number of products and test the merging logic.

Can the original variants be removed from the feed after merging?#

Yes, Mergado hides them automatically – only the Master product remains in the output. Variants remain in the project for reference but are no longer written to the output feed.

Can the merging result be exported for review or backup?#

Yes. Open the output feed and check that products were correctly grouped under one Master product.

Can this rule be combined with the “Calculation” or “Rewrite” rule?#

Yes, but the Merging Variants rule will always be automatically placed last in the rule order. So element values are first modified, and only then are variants merged.

🇨🇿 🇬🇧 🇩🇪 🇭🇺