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

Viewed 130

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!

1 Answers

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 }}

Related