How to show total number of products in a collection

julie_b
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
Jason
Shopify Expert
10360 158 2005

see collection.all_products_count.

{{ collection.all_products_count }}

 

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
julie_b
Excursionist
29 0 6

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

0 Likes
Jason
Shopify Expert
10360 158 2005

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

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
julie_b
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
Jason
Shopify Expert
10360 158 2005

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.

 

 

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
julie_b
Excursionist
29 0 6

This is perfect, thanks for your help.

0 Likes
raxhid
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
raxhid
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
Alex-RightGeek
Shopify Partner
21 3 9

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