see collection.all_products_count.
{{ collection.all_products_count }}
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 ?
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 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
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 %}
User | Count |
---|---|
445 | |
187 | |
139 | |
61 | |
44 |