Conditional display as per Tag or Tags in Products on Shopify Website

0 Shares
0
0
0

We can use for loop with IF or Unless

FOR LOOP Condition example

{% for tag in product.tags %}
  {% if tag contains 'FreeGift' %}FREE PRODUCTS {% break %}{% endif %}
{% endfor %}

Easy way to use UNLESS Condition example

{% for tag in product.tags %}
  {% unless tag contains 'FreeGift' %} NO FREE PRODUCTS {% endunless %}
{% endfor %}