Ad

Shopify - Looping Collection

- 1 answer

I'm working with a shopify theme and I would like to loop over each product in a collection. I created a product and I added it to a collection called "landing". However, it's not appearing in this loop. Any ideas where I should look?

Thanks!

{% for product in collections.landing limit:3 %}
    <h3>testing</h3>
{% endfor %}
Ad

Answer

This one should work properly:

{% for product in collections.landing.products limit:3 %}
    <h3>testing</h3>
{% endfor %}

Make sure the product you've added to the "landing" collection is set to be visible in the online store.

Ad
source: stackoverflow.com
Ad