Shopify themes, liquid, logos, and UX
Hey guys, I might need your help with something. I am looking for solution how to add to vendor collection name. I have found this code and put it to main product liquid:
{% for collection in product.collections %}
<p class="collection-title">{{ collection.title }}</p>
{% endfor %}
It is working just fine BUT If the product has more collection, then it shows all of them. Is there any solution how to edit this code to show only one collection and not all of them? Thank you
Hi @Vlk1 ,
May I suggest 2 solutions below:
1. code to show the first collection
{% assign collection = product.collections | first %}
{{ collection.title }}
2. Add "within: collection" to url of product. In product liquid only use {{ collection.title }} to show it.
Hey, thank you. I am not sure if I got it right but when I put it to product liquid, nothing happend.
Hi,
If you used in Assets/card_product.liquid. May I suggest code below:
{% assign collection = card_product.collections | first %}
{{ collection.title }}
I have edited it but it shows still name of my store as a vendor, not collection
Hi,
Could you please share your store url that you applied code?
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024