I'm trying to do something similar to this question:
Shopify - If item in cart belongs to a specific collection
and I've tried editing the code to suit my needs but it seems to be doubling the output.
What I want is to check to see if any of the items in the cart belong to a particular collection (or check the titles) and then show a related item underneath.
My current code is:
{% for item in cart.items %}
{% for collection in item.product.collections %}
{% if collection.handle == "mukluks" %}
this is a mukluk
{% endif %}
{% endfor %}
{% endfor %}
However that outputs "this is a mukluk" every time there's a match. I'm still trying to figure out how to limit it to just one. Maybe with forloop?