Guide to Displaying Klaviyo product ratings
Bundly lets you surface Klaviyo’s star-rating widget for every product inside a bundle. You simply store the widget’s HTML in a product-level metafield and tell Bundly which metafield to render.
If you have never added extra product data before, see How to Display Additional Information for Each Product.
Automating Metafield Updates with Shopify Flow
- Install the Shopify Flow app if you have not already.
- Build a new workflow:
- Trigger → Scheduled time (run every 10 minutes).
- Action → Get product data
- Filter → Updated in the last day
- Sort by Updated at Descending
- Maximum number of products → 100
- For each →
item in getProductData
- Action → Update product metafield
- Namespace →
bundly
(or another namespace you prefer) - Key →
extra_data
(or another key you prefer) - Type → Multiline text
- Value →
- Namespace →
<div class="klaviyo-star-rating-widget" data-id="{{getProductDataForeachitem.legacyResourceId}}" data-product-title="{{getProductDataForeachitem.title}}" data-product-type="{{getProductDataForeachitem.productType}}"></div>
- Save the workflow and wait 10 minutes for the first run. All recently updated products will now carry the widget markup in their metafield.
2. Tell Bundly to show the metafield
- Open the Theme Editor for your bundle.
- Select the Bundle Information app block.
- In Custom data metafield, enter the exact namespace and key you used above (e.g.,
bundly.extra_data
). - Save.
3. Re-render ratings after shoppers interact with the bundle
Klaviyo’s script needs to be called again whenever the bundle layout changes (for example, after collapsing a section or adding an item). Add this snippet to the Custom Liquid field of the same Bundly block:
<script> document.addEventListener('bundly:afterUpdateBlock', function() { window.klReviewsObject.renderWidgets(); }) </script>
Need help?
If anything is unclear or you hit a snag, reach out to our support team. We are always happy to assist.