Hello,
I want to show the lists of collections of the product on product page. But only collection with a metafield value. I try two options, but they doesn’t work.
1
{% for collection in product.collections %}
{% if collection.metafields.custom.collectionType == Brand %}
<b><a href="{{ collection.url }}">{{ collection.title }}</a>
</b>
{% endif %}
{% endfor %}
output of “collection.metafields.custom.collectionType” is [“Brand”] or [“Speciale”] or [“Categoria”], but this code show me only collections without any collectionType assigned.
2
{% assign filteredCollections = product.collections | where: 'collection.metafields.custom.collectionType', 'Brand' %}
{% for collection in filteredCollections %}
<b><a href="{{ collection.url }}">{{ collection.title }}</a>
</b>
{% endfor %}
this one do not show anything.
Any ideas?