Skip to content

Instantly share code, notes, and snippets.

@fditrapani
Created October 20, 2014 14:20
Show Gist options
  • Save fditrapani/1c958e02ba924a43ddcb to your computer and use it in GitHub Desktop.
Save fditrapani/1c958e02ba924a43ddcb to your computer and use it in GitHub Desktop.
{% for option in product.options %}
{% if option == 'Color' %}
{% assign index = forloop.index0 %}
{% assign colorlist = '' %}
{% assign color = '' %}
{% for variant in product.variants %}
{% capture color %}
{{ variant.options[index] }}
{% endcapture %}
{% unless colorlist contains color %}
<img src="{{ color | downcase | append: '.gif' | asset_url }}"
alt="{{ color }}" width="16" height="16" />
{% capture tempList %}
{{colorlist | append: color | append: ‘ ‘}}
{% endcapture %}
{% assign colorlist = tempList %}
{% endunless %}
{% endfor %}
{% endif %}
{% endfor %}
@CJohnDesign
Copy link

So sick! thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment