How to add promotion / custom bloc to the collections pages

OpuSsS
New Member
1 0 0

I'd like to add custom blocks to my products loop in the collections pages. Right now, i've tried it by adding a custom "promo" tag to some of my products and use conditional rendering in my template files to hide price/link/title. But it's not super intuitive, and since i use a custom tag filter it adds this category to it... How can i do this without using apps ? here is an example :

 

 zefzgrzrgezrg.png

0 Likes
JoesIdeas
Shopify Expert
1263 116 323

You could try using forloop.index  and do something different in index == x, or every x items, or if you want it in a random spot, assign a random number then match that with the index for where to put the promo card.

https://shopify.dev/docs/themes/liquid/reference/objects/for-loops#forloop-index

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfillment + more automations).
More apps: Theme Scientist (A/B testing), Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
0 Likes