Tester JC

 

ASIF'S CODE FOR COLOUR SELECTOR

<select name="id" id="ProductSelect-product-template-{{product.id}}" class="product-form__variants no-js">
{% for variant in product.variants %}
{% if variant.available %}
<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ variant.id }}">
{{ variant.title }}
</option>
{% else %}
<option disabled="disabled">{{ variant.title }} - {{ 'products.product.sold_out' | t }}</option>
{% endif %}
{% endfor %}
</select>
{% capture colour_variant %}
{% for variant in product.variants %}
{% for option in variant.options %}
{% if product.options[forloop.index0] == 'Color' %}somestring,{% endif %}
{% endfor %}
{% endfor %}
{% endcapture %}

{% assign colour_variant_split = colour_variant | split: 'somestring,' %}
{% assign colour_count = colour_variant_split.size | minus:1 %}

{% if colour_count > 1 %}
{% if product.available and product.variants.size > 1 %}
{% include 'swatch' with 'Color' %}
{% endif %}
{% endif %}