Re: Can I make a custom array of products and provide the array to the pagination snipet?

Can I make a custom array of products and provide the array to the pagination snipet?

Petlya
Shopify Partner
6 0 5

Hello! I`m rendering products based on handlers. Like so https://i.imgur.com/5bmL0gc.png  where i ===product handler. I`m wondering how can I use the same approach and provide a custom array of products for pagination. I tried something like this https://i.imgur.com/iZ5KjbF.png but bumped into the following error https://i.imgur.com/k5y7Eby.png . Does it feasible at all?

Thanks in advance!

Replies 5 (5)

CalebV
Shopify Partner
15 0 4

I am attempting to do the same thing. According the the liquid theme docs, currently you cannot paginate a custom array and they have a list of specific arrays that you can paginate through. I hope to be able to accomplish this eventually

Petlya
Shopify Partner
6 0 5

Hello! Have you accomplished the task?

 

 

brunog_fetch
Shopify Partner
1 0 0

I'm trying to implement the same thing, if you guys have any updates please pin me

Nourishe
Shopify Partner
12 0 8

We have the same need. I am pulling an array of products based on ingredients, and then attempting to paginate through them. If anyone has any suggestions, please share them.

Organic & Vegan Skincare
Nourishe.co

kaustubh_m
Shopify Partner
1 0 0

As per my research there is a documentation Shopify Paginate   on pagination that mentions only specific Shopify `array of objects` that can be paginated. If you try to mutate this array and assign it to variable and the try paginate then it won't work as well!.

Hope it helps!