Skip to content

Instantly share code, notes, and snippets.

@voskresla
Created April 3, 2018 13:27
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 voskresla/a3f7b21f6b5ab5fe8e28429028eded08 to your computer and use it in GitHub Desktop.
Save voskresla/a3f7b21f6b5ab5fe8e28429028eded08 to your computer and use it in GitHub Desktop.
inSales product-color-id hardcoded
<ul class="product__option--color">
{% assign color_id_array = product.fields.color_id.value | split: ',' %}
{% assign inverse = false %}
{% case product.properties.tsvet.characteristics.first.name %}
{% when 'Белый' %}
{% assign color = 'rgb(255,255,255)' %}
{% assign inverse = true %}
{% when 'Зелёный' %}
{% assign color = 'rgb(15,101,55)' %}
{% endcase %}
<div class="li_wrapper active">
<li {% if inverse %} class="white_black" {% endif %} style="color: {{color}};"></li>
</div>
{% for product in collections[product.canonical_collection.handle].products %}
{% for i in color_id_array %}
{% if product.sku == i %}
{% assign inverse = false %}
{% case product.properties.tsvet.characteristics.first.name %}
{% when 'Белый' %}
{% assign color = 'rgb(255,255,255)' %}
{% assign inverse = true %}
{% when 'Зелёный' %}
{% assign color = 'rgb(15,101,55)' %}
{% endcase %}
<div class="li_wrapper">
<a href={{product.url}}>
<li {% if inverse %} class="white_black" {% endif %} style="color: {{color}};"></li>
</a>
</div>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment