Marina Petrović
Marina Petrović

Reputation: 31

Is it possible to show all products from collection.template?

I hope someone could help with this... Is it possible to show all products from another collection template? So, this is regular "call": collections.all.url. And I'm trying to achieve something like this collections.wholesale.all.url. Of course, that's not the right way. Thanks in advance!

Upvotes: 1

Views: 445

Answers (1)

Juandres Yepes Narvaez
Juandres Yepes Narvaez

Reputation: 163

If you know the handle of the collection you want, do:

{% for p in collections['YOUR_HANDLE_HERE'].products %}
    {{ p.title }}
    {{ p.price | money }}
    .... etc
{% endfor %}

You can not get collections by the template they are using, regardless of the amount of collections using a template. you can ONLY retrieve an individual collection by it's handle.

{{ collections['YOUR_HANDLE_HERE'] | json }}

Upvotes: 2

Related Questions