Hey, I'm trying to add sentence near the variant - if specific tag is included.
This is the original:
{% if line.line_item.variant.title != 'Default Title' %}
<span class="order-list__item-variant">{{ line.line_item.variant.title }}</span><br/>
{% endif %}
This is what I have tried:
{% assign break_loop = false %}
{% if line.line_item.variant.title != 'Default Title' %}
<span class="order-list__item-variant">{{ line.line_item.variant.title }}</span>
{% for line in line_items %}
{% for tag in line.product.tags %}
{% if tag == 'slim' %}
<p> SLIM [.75" THICK]</p>
{% break %}
{% assign break_loop = true %}
{% elsif tag == 'standard' %}
<p> STANDARD [1.25" THICK]</p>
{% break %}
{% assign break_loop = true %}
{% endif %}
{% endfor %}
{% if break_loop %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
I have two different tags, and with this code it is add two times the sentence - and if the order contains two products from different tags - it shows the two sentences for each one of the products...
This is the original outcome:
And this is my code outcome:
What can I do?
Thank you!
User | Count |
---|---|
862 | |
113 | |
100 | |
97 | |
76 |