Re: How do I make the collection list show all the collections on one page?

How do I make the collection list show all the collections on one page?

lukafernada
Explorer
151 2 56

As shown in the photo, it only allows you to see 30 collections before having to click onto the next page. What code is there to make it show all the collections on the same page, but only on the 'All Collections' page

Screenshot 2024-09-25 at 21.33.10.pngScreenshot 2024-09-25 at 21.33.14.png

Replies 11 (11)

Shadab_dev
Shopify Partner
584 36 66

If the customizer does not provide any option then probably you will need to update the code in your theme editor.

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
lukafernada
Explorer
151 2 56

yes, my question is how

Shadab_dev
Shopify Partner
584 36 66

I believe i kind of know the answer not sure but i feel i do, can you please share the name of the theme you are using?

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
lukafernada
Explorer
151 2 56

im using the dawn theme

Shadab_dev
Shopify Partner
584 36 66

Great. I have the code. 

So open your code editor and open main-collection-product-grid.liquid file under sections folder and paste this code

{% assign products_per_page = section.settings.products_per_page %}
{% if collection.handle == 'all' %}
{% assign products_per_page = collection.products.size %}
{% endif %}
{%- paginate collection.products by products_per_page -%}

Where do you have to paste this?

Shadab_dev_0-1727577046924.png


Just between line 39 and 40 or search for paginate object like in the image and paste the code. Please watch carefully that there is change in paginate object as well and that is included in the code.

I have checked this. So only for all collections all products will show up but when you are on a specific collection it will show only the products that you have provided from the customizer and include paginations if required.

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
lukafernada
Explorer
151 2 56

Hello, sorry this wasn't my issue.

 

My issue was making all collections show up on my page that shows 'All Collections' - not the products that show up on a collection.

 

Would you still know how I can do this?

Shadab_dev
Shopify Partner
584 36 66

Hi @lukafernada sorry if I wasn't able able to understand your requirement.

 

Just wanna confirm that, have you tried this?

 

And also do you have like a certain example site or something that might help me understand this better.

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
lukafernada
Explorer
151 2 56

Yes, I actually already have that code in place.

 

No I don’t have an example site, how can I create one ?

Shadab_dev
Shopify Partner
584 36 66

All right let me give it one more try. May be I have got it. Will update you

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
lukafernada
Explorer
151 2 56

thank you so much !

Shadab_dev
Shopify Partner
584 36 66

Got it this will definitely do it for you.

So open your main-list-collections.liquid file under sections in your code editor.

Shadab_dev_0-1727667551376.png

Just after line 24 or the endif statement i have circled paste this 3 lines of code. Make sure its within -%} just as in the image.
The code:

 

if request.path == '/collections'
assign paginate_by = collections.size
endif

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.