Hello,
I am using the minimal theme and am looking to customise the related-products feature to ignore some of my collections. I want to ‘ignore’ the collections that are at the parent level of my category tree, only ‘including’ child collections e.g. ignore ‘for special occasions’ parent collection, include ‘christmas’ child collection.
Can anyone help with the code that I need to add to achieve this?
Thanks!
{% assign number_of_products = 4 %}
{% assign number_of_products_to_fetch = number_of_products | plus: 1 %}
{% if collection == null or collection.handle == ‘frontpage’ or collection.handle == ‘all’ %}
{% assign found_a_collection = false %}
{% for c in product.collections %}
{% if found_a_collection == false and c.handle != ‘frontpage’ and c.handle != ‘all’ and c.all_products_count > 1 %}
{% assign found_a_collection = true %}
{% assign collection = c %}
{% endif %}
{% endfor %}
{% endif %}
{% if collection and collection.products_count > 1 %}