Ad

Shopify Paginate Limit

- 1 answer

How to limit the pagination using dropdown paginate collection.products by 12

select                     
     option selected="select" View as 16 items/page option
           select
       endpaginate 
Ad

Answer

I guess you want to create a select dropdown like this.

enter image description here

To do that first you need to add new collection template, name it as collection.12.liquid . Repeat the process to create more templates like 16 , 24 , 32 as you need.

enter image description here

Now edit each template and change the pagination limit code for each template accordingly.

{% paginate collection.products by 12 %}

or

{% paginate collection.products by 16 %}

Now you can create the select dropdown for changing to different pagination templates by using ?view=XX parameter

example :

https://your-shop.myshopify.com/collections/bags?view=16 https://your-shop.myshopify.com/collections/bags?view=24 https://your-shop.myshopify.com/collections/bags?view=32

Let me know if you have any questions.

Thanks

Ad
source: stackoverflow.com
Ad