{% assign number_of_related_products_to_show = 4 %} {% assign image_size = 'compact' %} {% assign heading = 'Other fine products' %} {% capture number_of_related_products_to_fetch %}{{ number_of_related_products_to_show | plus: 1 }}{% endcapture %} {% 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 %}