I am using Dawn theme. I created a masonry/grid photo gallery using shopify’s block creator to show my products, however even though I have 85 products it only shows 50 max. I read that shopify only allows 50 products per page but I am wondering if there is custom code that can be added/edited in the theme files to allow more products page page, or if anyone is available to help customize the theme to allow it.
Hi @ljm77 ,
I hope this message finds you well .
You cannot bypass Shopify’s 50-item limit with theme edits.
But you can do pagination .
If you want to do pagination , Please share your store URL and password if password protected .
Please share the collaborator code with me via a personal message (it should not be shared publicly).
Thanks
Manoj
Change the Products Per Page in Theme Code
-
Go to your Shopify Admin → Online Store → Themes.
-
Find Dawn, click … → Edit code.
-
Open this file:
sections/main-collection-product-grid.liquid -
Search for:
{% paginate collection.products by section.settings.products_per_page %}or
{% paginate collection.products by 24 %} -
Change the number to what you want (e.g., 100):
{% paginate collection.products by 100 %} -
Save.
Hi @ljm77,
You can try changing by 255:
{% paginate collection.products by 250 %}
{% endpaginate %}
Hope it can help you
Hi Manoj, sorry for the delay. I was finishing up another project and just getting back to this. To add pagination, is there a way to have a button that says “load more” and adds more products showing within the same page, or does it have to be a link to the next page at the bottom? I would prefer people stay on the same page and not have to scroll through pages if possible. Thank you.
Thank you for your reply. Unfortunately didn’t work, still shows 50 products max.
Thank you, tried this before I posted on this forum as I found it in other search results but did not work, still shows 50 products max.
Solutions above are for the main “product grid” section on collection page.
Looks like your situation is different.
Is it a “Featured collection” section or a custom section based on it? Or something different?
Basically – every loop, say, over products is limited to 50 elements.
If you want to output more than that – you need to use {% paginate ... by XX %} tag. This is the only way to get over 50 (but not over 250 anyway).
Also, not all lists can be treated like this, so, for example, if your collection comes from the section settings, pagination will fail.
In this case, you’d need to load more “objects” with Javascript.
Say, Featured collection section in Dawn – this code would no work even if you allow products_to_show to be up to 250. The limit is still 50.
However, this would work:
{% assign co = collections[section.settings.collection.handle] %}
{% paginate co.products by section.settings.products_to_show %}
{%- for product in co.products limit: section.settings.products_to_show -%}