Skip to main content
All CollectionsIntegrationsShopify
Product Bundle Grouping Using Shopify Metafields
Product Bundle Grouping Using Shopify Metafields

How to set up product bundle grouping using Shopify Metafields

Daniel Jozwiak avatar
Written by Daniel Jozwiak
Updated over a week ago

Requirements

⭐️ Active REVIEWS.IO account

✅ Active Shopify account


Instructions ⚙️

Creating the Bundles 📝

Firstly, you will need to create a new shopify metafield for the bundle. This can be done by navigating to your Shopify store Settings > Custom Data > Products > Add Definition

In here, you will want to name your bundle reviews_bundle and give it a description. You will have to set the type to Product > List of Products

You will then want to add products you wish to be included in the bundle by following these steps:

  1. Head to your products tab and go into one of the products

  2. Scroll down to the Metafields section

  3. Press the "View all" button

  4. Within the bundle you have just selected, add any products you wish to be included in the bundle

Installing the Code 👨‍💻

You will need to manually install the code for one of our widgets into your shopify theme. You can check out how to do this here:

You will need to set up this additional code to make sure we include your newly created bundles

⚠️ This code will work for both bundle and non-bundle products and can be installed on all product pages ⚠️

{% capture reviewsSku %}
{{ product.handle }};
{{- product.variants | map: "sku" | join: ";" -}};
{{ product.variants | map: 'id' | join: ';' }};
{% for reviews_bundle_sku in product.metafields.custom.reviews_bundle.value %}
{{ reviews_bundle_sku.handle }};
{% endfor %}
{% for reviews_bundle_sku in product.metafields.custom.reviews_bundle.value %}
{{ reviews_bundle_sku.variants | map: "sku" | join: ";" }};
{% endfor %}
{{ product.variants | map: "id" | join: ";" }};
{% for reviews_bundle_sku in product.metafields.custom.reviews_bundle.value %}
{{ reviews_bundle_sku.variants | map: "id" | join: ";" }};
{% endfor %}
{% endcapture %}

This will replace the code that we use to pull through your product SKUs, in order to implement this to the widget, you will need to add this above the widget code in the section/snippet you have just installed.

Within the widget code itself, you will need to make a small adjustment to the SKU line:

sku: "{{ reviewsSKU }}",

Did this answer your question?