Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
hello Community !
I want to add specific collection name below product name ,but by default random or may be first collection is popping up,is there any way i can target specific collection.
In the screenshot you can see collection name showing as New arrival & Men as these products are added to multiple collection , but i want Oversized collection to appear ,please help me if you are aware about the solution.
Thank you !
code i used :
{% assign pro_collection = product.collections.first %} {% if pro_collection %} This product is part of my {{ pro_collection.title | link_to: pro_collection.url }} Collection {% endif %}
Hey, @ParthPapat thanks for posting here.
please use this method to show specific collection on product card
{% assign specific_collection = "Oversized" %}
{% assign matched_collection = null %}
{% for collection in product.collections %}
{% if collection.title == specific_collection %}
{% assign matched_collection = collection %}
{% endif %}
{% endfor %}
{% if matched_collection %}
This product is part of my
<a href="{{ matched_collection.url }}">{{ matched_collection.title }}</a> Collection
{% else %}
No matching collection found.
{% endif %}
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025