Shopify themes, liquid, logos, and UX
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 <h1> tag doesn't show, however if one of the products has the tag, all the products show the <h1> tag.
Am I doing something wrong or misunderstanding how liquid/tags work on the cart page?
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024