I need to show the collection description on the product page. I’m currently using the following code with an if condition wrapped around it:
{{ collection.description }}
This shows if the URL of the product is from /collections/[collection-name]/products/[product-name]. That’s only when I start browsing from “all collections”. But the description is empty when opening products directly from the shop or search, that is when the URL looks like [domain]/products/[product-name]
I understand that a product can have multiple collections, but how can I show the parent or any collection description on a product page?
Cheers
@hanfasted
Sorry you are facing this issue, it would be my pleasure to help you.
Welcome to the Shopify community! 
Thanks for your good question.
Please share your site URL,
I will check out the issue and provide you a solution here.
Hi @hanfasted ,
Please change code:
{%- if collection -%}
{{ collection.description }}
{%- else -%}
{{ product.collections[0].description }}
{%- endif -%}
Hope it helps!
Why would you want the collection description to show up on product pages? You’d end up with identical descriptions repeated on multiple product pages. Also, since products can belong to more than one collection, how do you decide which collection’s description to show?
A better way to include content across multiple product page would be to use metafields. But the problem with duplicating content across multiple product pages remains.