Hey,
Try this out:
{% assign total_colors = 0 %}
{% if product.available and product.variants.size > 1 %}
{% for option in product.options %}
{% if option contains 'Color' %}
{% for variant in product.variants %}
{% assign total_colors = total_colors | plus: 1 %}
{% endfor %}
{% else %}
<small>No Color variants</small>
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% if total_colors > 0 %}<small>Colors available - {{ total_colors }}</small>{% endif %}
User | Count |
---|---|
25 | |
21 | |
20 | |
16 | |
15 |