How can I automatically display color variants on a product card in DAWN theme?

How can I automatically display color variants on a product card in DAWN theme?

Deoxes
Navigator
361 2 85

Hi,

 

Maybe someone could help me with color.option or name I'm not sure.

I found and added on product card:

 

<div class="card__badge--new">
{% for tag in product.tags %}
{%- if current_tags contains 'NEW' -%}
<span> NEW! </span>
{% endif %}
{% endfor %}
</div>

 

This code, if you tag on product "NEW" it shows NEW, but how I can add if my product has variants, for example few color swatches, black and red, I can create color with the tag and it starts to show, but how I can create code to automatically if the product has color variant, it starts to show my created word? Because my theme is DAWN and it doesn't have that function on the collection page to show color swatches.

 

I need if the product has colour variants, it starts to show automatically badge on my product card (which I will create).

 

Thanks

Reply 1 (1)

Deoxes
Navigator
361 2 85

I found that code:

{% if option_values.color > 1 %}
<a class="more-colors">MORE COLORS</a>
{% endif %}

 

But it is not working.