Doofinder logo

Support Documentation

Search icon

Grouping Product Variants

Grouping product variants in the data feed that share the same basic set of attributes can help you improve your search results.

Say you have these items in your feed:

  • Nike Sportswear Phoenix Hoodie (size: S; color: baby pink)

  • Nike Sportswear Phoenix Hoodie (size: M-L; color: mint green)

These are two different products, and when looking for "hoodie", the two would show up in the search results:

Grouping products variants

However, you may prefer the user to obtain just one "Nike Sportswear Phoenix Hoodie " search results with all variants of colours and sizes available in the filters of your search results.

This way, when the user looks for a "Phoenix Hoodie", only one result is shown, but all colors and sizes are available at the filters panel.

Grouping variants example

Group Variants As a Single Item

Using Doofinder, you can set this up in the following simple steps:

  1. Go to Configuration > Indices > Configuration and enable the Group variants as a single item option in the pop-up window, click "Save".
  2. Grouping variants in the feed
  3. Ensure the products you want to be grouped share the same group_id field in your data feed.

Using the Item group_id

Alternatively, you may use the de-facto standard by Google from the data feed: the item group id. Through this, all items with the same group_id attribute are considered variants of the same item.

Consequently, when you check the group products by group_id, all products that share the same group_id attribute are displayed as one product only in the search results. Still, all their variants, like colour or size, if defined as filters, are displayed in the filters.

Note that updating the group_id of an item will affect the grouping.

If you are indexing through API, make sure the value for group_id is a string.

Marking an Item As Group Leader

Follow the Leader

If there's an item with the field group_leader set to "true", that item will be chosen as the group representative in search results (if there are no other relevant sort criteria involved). All other items in the group must have the group_leader field set to "false". This way, the leader will be differentiated from the rest.

If you are using the API, you need to set a boolean value for group_leader. Currently, we accept a pure boolean or string, example: true, false, "true", "false".

Lastly, the field name could be in two formats:

  • Text Format

    Grouping items: For product type feeds, you can use the group ID, group_id. This will work for every data type (not just the product data type).

    Marking an item as the group leader: You use the group_leader field.

  • XML Format

    Grouping items: For product type feeds. You can use group_id. This will work for every data type (not just the product data type).

    Marking an item as the group leader: You need to use group_leader.

Grouping Product Variants for the Add to Cart

To enable product variant selection directly from the Add to Cart button, refer to the Add to Cart documentation. This guide explains how to display variants on the Product Card (whether you're using plugins or custom feed), and how to configure the display order of variant values.

Did you find this page helpful?