Hide or add items for a specific product in the cart page.

nikexen
Visitor
1 0 0

I'm trying to find a way to solve an issue with adding or hiding items on a specific product using the product tag. I tried to use code for this:

{% for item in cart. items %}
{% if item.product.tags contains 'swatch' %}
// my text //
{% endif %}
{% endfor %}

But it didn't work for me, because this text was displayed in all products in the cart, even if other products did not have the "swatch" tag. Please help me solve this problem. Thanks!

Replies 0 (0)