Hello on my collection page want to display all the color variant only and not sizes but it´s calling all. I´m using wookie theme. This is the code I´m using:
{%- if collection.products.size > 0 -%}
{% for product in collection.products %}
{% assign color_active = false %}
{% for option in product.options %}
{% if option == ‘Color’ %}
{% assign color_active = true %}
{% endif %}
{% endfor %}
{% if product.variants.size > 1 and color_active == true %}
{% for option in product.options %}
{% if option == ‘Color’ %}
{% assign index = forloop.index0 %}
{% assign colorlist = ‘’ %}
{% assign color = ‘’ %}
{% assign color_scheme = ‘’ %}
{% for variant in product.variants %}
{% capture color %}
{{ variant.options[index] }}
{% endcapture %}
Thank you for your help, when I put the code in the variant loop stop working and just display the main product. That´s the issue that it´s been happening so far, any idea on another solution? TIA