Skip to content

Instantly share code, notes, and snippets.

@yuchant
Created March 29, 2016 18:09
Show Gist options
  • Save yuchant/998d9184b7466d96cb45d8c52e3d5128 to your computer and use it in GitHub Desktop.
Save yuchant/998d9184b7466d96cb45d8c52e3d5128 to your computer and use it in GitHub Desktop.
Shopify Iterate over options in cart
<div class="cart__options">
{% for i in (0..2) %}
{% assign variant_option_key = i | plus: 1 | prepend: "option" %}
{% assign variant_value = item.variant[variant_option_key] %}
{% if variant_value %}
<div class="cart__option">
{{ item.product.options[i] }}: {{ variant_value }}
</div>
{% endif %}
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment