I’m trying to write a statement that hides/shows a “*Final Sale”
tag based on whether a product is on sale/tagged with “FINAL SALE” on the cart page. I’m not sure if there is a way to check the product.tags for an item in the cart, but if there is I’d like to know.
I have tried a few different statements that have not worked so I wanted some input from all you smart people on this forum.
{% for item in cart.items %}
{% if item.line_price > item.original_line_price %}
<div style="float: left; width: 100%;">
<p style="font-size: 11px; color: red;">*Final Sale</p>
</div>
{% endif %}
{% endfor %}
{% for item in cart.items %}
{% if product.tags contains "FINAL SALE" %}
<div style="float: left; width: 100%;">
<p style="font-size: 11px; color: red;">*Final Sale</p>
</div>
{% endif %}
{% endfor %}
This did not work unfortunately. I believe the syntax that needs to be used starts with ‘item.’ instead of ‘product.’ since we are in the cart, but I also tried the below and that didn’t work either.
{% for item in cart.items %}
{% if item.compare_at_price_max > item.price %}
<div class="final-sale-note">
<p style="font-size: 11px; color: red;">*Final Sale</p>
</div>
{% endif %}
{% endfor %}