How to show total number of products in a collection

Highlighted
Excursionist
29 0 6

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
Highlighted
Shopify Expert
10006 116 1818

see collection.all_products_count.

{{ collection.all_products_count }}

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Excursionist
29 0 6

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

0 Likes
Highlighted
Shopify Expert
10006 116 1818

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
Highlighted
Excursionist
29 0 6

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
Highlighted
Shopify Expert
10006 116 1818

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
Highlighted
Excursionist
29 0 6

This is perfect, thanks for your help.

0 Likes
Highlighted
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
Highlighted
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
Highlighted
Shopify Partner
21 3 8

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.. info@rgeekdigital.com