Can you display only one product per tag on a Shopify collection page?

Julia_2
Shopify Partner
14 0 2

I've created tags and group same products but with different colors into this tags.

Now I would like to show on the collection page only one product per tag

I was trying something like this but I don't want to write manually every tag, I would like just to loop through and show one product per this tag.

 

Thank you in anvance

 

<div class="row">
{% assign oneShown = false %}
      {% for product in collections.daily_deals.products %}
          {% if oneShown %}
             {% break %}
          {% endif %}
          {% if product.tags contains 'frontpagedeal' %}  
              {% include 'dailydeal-countdown' %} 
              {% assign oneShown = true %}
          {% endif %}
      {% endfor %}
</div>

 

Replies 0 (0)