Hello,
I am trying to us the following code on the cart page to check if a product has a tag, if it does display text, however when I do this and there is more than 1 product in the cart (with different tags) it displays the text for each product.
This is a example of my code:
{% for item in cart.items %}
{% if item.product.tags contains 'shiptoday' %}
<h1>Ships Today</h1>
{% endif %}
{% endfor %}
This would be underneath the product title, as a test I have noticed if there is multiple products but none of them contain the product tag then the
tag doesn’t show, however if one of the products has the tag, all the products show the
tag.
Am I doing something wrong or misunderstanding how liquid/tags work on the cart page?