How to show total number of products in a collection

Tourist
26 0 3

I would like to show the total number of products within a collection. ie. on page one of the collection it would say 'Items 1-12 of 150 total' etc.

Have searched through the forums cannot find anything on this topic...

Any help appreciated.

0 Likes
Shopify Expert
9811 92 1561

see collection.all_products_count.

{{ collection.all_products_count }}

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
26 0 3

This just shows '62' at the top of the collection page ?

0 Likes
Shopify Expert
9811 92 1561

62 would be total number of products in the collection. Isn't that what you are asking?

How to show total number of products in a collection

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
26 0 3

My question was

"I would like to show the total number of products within a collection. ie. on page one of the collection it would say 'Items 1-12 of 150 total' etc."

When my customer sees the number 62 sitting at the top of a collection is doesn't mean much to them, can I show this exactly as I have asked above ?

0 Likes
Shopify Expert
9811 92 1561

can I show this exactly as I have asked above ?

Yes. What I've given you will get you some of the way there already. The next step for you is reading up on the pagination object and just hand picking the variables you want to show.

 

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
26 0 3

This is perfect, thanks for your help.

0 Likes
Tourist
6 0 0

i couldn't found collection.all_products_count. on my code editor? from where i can change this setting i am also looking for total product count on top of collection Page with pagination 

0 Likes
Tourist
6 0 0

which veritable or class u added to show same as you required because i need same thing but pagination didn't works 

0 Likes
Excursionist
13 2 2

If you are here what you are probably looking for is: 

{% if paginate.next.is_link %}
Showing products {{ paginate.current_offset | plus: 1 }} - {{ paginate.current_offset | plus: paginate.page_size }} of {{ collection.all_products_count }}
{% else %}
{% capture itemsOnCurrentPage %}
{{ collection.all_products_count | minus: paginate.current_offset }}
{% endcapture %}
Showing products {{ paginate.current_offset | plus: 1 }} - {{ paginate.current_offset | plus: itemsOnCurrentPage }} of {{ collection.all_products_count }}
{% endif %}
I make custom Shopify pages & themes.. rgeekdigital.com | info@rgeekdigital.com
0 Likes