Hi everyone,
I’m facing this issue where pagination isn’t working as expected when paginating section.settings.collection. Code below.
From the image below, you can see that the forloop displays all products in the collection (there are 22 products) even though I’ve set a limit of just 10.
Page numbers are correct though.
Does anybody know why this is happening and how I can fix this?
It’s all fine if it’s changed to global collection, and used in a collection page.
Hi @Paul.Martin.Lopez
Are you adding this to a non-collection page?
Yes, I plan to add it to a non-collection page (metaobject page).
Upon checking the docs for paginate, it says that collection.products is paginate-able. It didn’t mention that it has to be a collection page in order for it to work.
Does it have to be a collection page in order for it to work?
If you test on a collection page, does it work as expected?
Yes.
I’m just baffled because when this is added to a non-collection page, the pagination works (ie. it can create links to next page etc), but the forloop doesn’t work as expected.
The docs for collection.products also didn’t mention that when paginating it, it has to be on a collection page in order to work 100%.
Hi @Paul.Martin.Lopez
I agree this limitation should be documented - will get this updated asap!
1 Like