Product Page Link to Show collection

Highlighted
New Member
3 0 0

Hi

I am using the loft theme and I was wondering if there is a way to have the product page to show the collection

i.e, like this is part of the XXX collection, so that someone can click that and it links to the collection.

 

Is that something that is easy to add?  Any suggestions on how to.

I searched for ages but couldn't find anything.

Thanks

Mark

0 Likes
Highlighted
Explorer
37 4 8

Hi LunnMH, 

Yes it is, try adding the following liquid code to you product page wherever you want it to show.  

{% for collection in product.collections %}
                  <li><a href="{{collection.url}}">{{collection.title}}</a></li>
{% endfor %}
0 Likes
Highlighted
New Member
3 0 0

Thanks, that worked but showed all collections it was part of.  Can you select a specific collection and only show that?

Thanks

Mark

0 Likes
Highlighted
Explorer
37 4 8

Hi Mark, 

Sorry, as of my current knowledge, there is no straightforward answer to that. I will definitely reach out to you once I find anything. Meanwhile, I hope, any expert can help you with that. 

Thanks

Simranjeet

 

0 Likes
Highlighted
New Member
3 0 0

Hi,

found this after your message:

https://community.shopify.com/c/Shopify-Design/RESOLVED-Display-Collection-on-Product-Page/td-p/2308...

Which is creating a linklist and putting the collections you want it to check there.  I have done it and it works perfectly.

My only question and maybe you know, is will this have any negative affects on the website?  For instance speed or conflicts?

I have about 30 collections on that linklist for it to lookup, but it works perfectly.

Thanks

Mark

 

 

 

0 Likes