Product Page Doesn't Load a Custom Section

Hey everyone,

Recently I have been trying to add a custom section to the product page where it shows other product from the same collection. The section used to load properly in the beginning but then suddenly disappeared for a reason that I could not detect.

I pass this snippet into my product template:

{% include 'custom-featured-collection', collection: collection, current_product: product %}

And the snippet code looks like this:


As you can see in the image, the HTML is displaying itself but the content in the HTML doesn’t:

I thought maybe there was a problem with the “product-list-item” snippet, but the collection description doesn’t load either so the issue is in here. It’s weird that it doesn’t show in product page because the section actually shows in another page in the website.

Does anyone have any idea about why this is happening?

Hi @batulkr ,

Because the collection object is not callable in the Product Page. You need to assign it first.
Please change code:

{% include 'custom-featured-collection', collection: collection, current_product: product %}

=>

{% assign collection_handle = product.collections[0].handle %}
{% include 'custom-featured-collection', collection: collections[collection_handle], current_product: product %}

Hope it helps!

Thanks so much!