How to Get Bundles Associated with a Particular Product, Variant, or Collection

If you’d like to check whether a specific product, variant, or collection is part of a bundle, you can do so using metafields. This is useful for adding “Bundle & Save” banners, showing custom content on product pages, or filtering products by bundle availability.


Use the Bundles References Metafield

Bundly automatically writes a metafield to each product and variant included in a bundle:

Namespace: bundly
Key: bundles_references
Type: List of product references

This metafield contains references to all the bundles that the product or variant is part of.


Example Usage in Liquid

To check if a product is part of any bundle:

{% if product.metafields.bundly.bundles_references.value.size > 0 %}
  <!-- This product is in a bundle -->
  <div class="bundle-badge">Bundle & Save</div>
{% endif %}

To display the names of the bundles:

{% for bundle in product.metafields.bundly.bundles_references.value %}
  <p>{{ bundle.title }}</p>
{% endfor %}

Need Help?

If you're not seeing expected results or need help implementing any of the above, contact us at support@bundly.app, we’re happy to help!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us