Skip to content

Instantly share code, notes, and snippets.

@basilkhan05
Last active February 2, 2022 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basilkhan05/7e37a71e5900235d114e765cd7ca20e5 to your computer and use it in GitHub Desktop.
Save basilkhan05/7e37a71e5900235d114e765cd7ca20e5 to your computer and use it in GitHub Desktop.
Liquid template to add bundle details to products in Shopify (Simple Bundles)
{% assign current_variant = product.selected_or_first_available_variant %}
{% assign bundled_variants = current_variant.metafields.simple_bundles.bundled_variants.value %}
{% unless bundled_variants == blank %}
<div class="product__description rte">
<p>This bundle includes:</p>
<ul>
{% for bundled_variant in bundled_variants %}
<li>
{{ bundled_variant.quantity_in_bundle }} x
{{ bundled_variant.product_title }}
{% unless bundled_variant.variant_title == 'Default Title' %}
({{ bundled_variant.variant_title }})
{% endunless %}
</li>
{% endfor %}
</ul>
</div>
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment