How to show custom collection on product page on Shopify for free?

{% for t in product.tags %}
     {% if t contains 'specific-collection' %} 
     {% assign collection = t %}
       {% for product in collections[collection].products limit:4 %} 
         <a href={{ product.url }}>
         <img src="{{ product.images[0] | product_img_url: "compact" }}" alt="{{ product.title | escape }}" />
         </a>
       {% endfor %}  
     {% endif %}
{% endfor %}

Add the following code in your product-template liquid file

This will display upto 4 products in your product page from ‘specific-collection’

Leave a Reply

Your email address will not be published. Required fields are marked *