Assign product template to all products inside a collection

Assign product template to all products inside a collection

Summoslammer
Visitor
1 0 0

Dear Shopify friends,

 

I would like to display a created product template on a specific collection.

If the product is not in the collection, the default product template may be adopted.

I have tried to place this template on the products within a collection but I can only do 50 products at a time and as it is quite a lot of products, this is unproductive work.

 

I already tried to add the following code to main-product.liquid but without success:

 

{% if product.type == 'BH' %}
{% include 'bh-maattabel' %}
{% else %}
{% include 'default.liquid' %}
{% endif %}

 

Collection name = 'BH

Name of custom template= 'bh-size table'

 

Question 1: Is it correct to include this code in main-product.liquid or does it belong in theme.liquid?

Question 2: How can I build in a logic that when it is recognized that it is a product from the collection that the created  custom product template is displayed? 

 

Thanks in advance! 

Replies 0 (0)