I am trying to load collection.all_products
expression to load all the products of a collection on collections page, but I am experiencing an issue with pagination.
I want to load all the products a collection is containing. So, I am using pagination to set limit on how many product it should load, otherwise it only loads 50 products.
I am using following expression to set pagination product limit:
{% paginate collection.all_products by collection.all_products_count %}
with expectation that collection.all_products should contain all the products.
The expressions works as expected, i.e. returns array of all the products when it is on the first page of the collection, but when I switch to different paginated page of the collection, it returns empty array for all_products.
One thing I noticed is, on paginated page, collection.all_products_count still returns correct number but collection.all_products is empty.
Please, If anyone have faced a similar issue and know a workaround to load all products of a collection on different page, let me know.
Thanks in advance.
PS: I am using Debut theme.