Created
April 3, 2018 13:27
-
-
Save voskresla/a3f7b21f6b5ab5fe8e28429028eded08 to your computer and use it in GitHub Desktop.
inSales product-color-id hardcoded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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