All things Shopify and commerce
I've done some research though couldn’t find a simple explanation of what code snippet to use to limit the products in a collection.
I appreciate that a "forloop" code might do the trick, though I couldn't find any clear indication of where and how to implement it.
Hope you can help!
This is my current collection code:
{
"sections": {
"product-grid": {
"type": "main-collection-product-grid",
"settings": {
"products_per_page": 40,
"image_ratio": "adapt",
"show_secondary_image": false,
"add_image_padding": false,
"show_image_outline": false,
"show_vendor": false,
"show_rating": false,
"enable_filtering": true,
"enable_sorting": true,
"collapse_on_larger_devices": false
}
}
},
"order": [
"product-grid"
]
}
Hello there, try to change this value: "products_per_page": 40, try to change 40 to any other number to see is working or not.
Thanks for the reply.
I think that would just limit the page size, though by scrolling down it would reveal the rest of the products.
Please correct me if I am wrong.
I am also looking on how to limit a collection to a certain number of items. I tried
Did you find an answer to this?
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025