Get number of products per page

New Member
2 0 0

Hey there can any one help me out 

I want to show items on current page out of total items in collections but i am not able to fetch the total no. of products on current page. PLEASE HELP!!!

<div class="productcount">{{ products_per_page }} out of {{ collection.products_count }} products</div>

 

0 Likes
Highlighted
Excursionist
28 6 7

you have to use paginate to achieve what you want, something like this:

{% 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 %}

 

Thank you - Best regards,
crotastic.io

Problem Solved?✔️Like and Accept the solution that can help others.

Your ROAS sucks?
Visit www.crotastic.io and receive your free Conversion Rate Optimization Report today. We offer optimization and customizations of your Shopify Store.

Email: mark@crotastic.io
Shopify Custom Theme Development | Custom Store Modifications | Store Conversion Rate Optimization | Shopify App Development
0 Likes
Highlighted
New Member
2 0 0

I do not want pagination, I already have load more button on my shop. I just want to display the no. of product on current page.

Please let help me out of this

0 Likes
Highlighted
Excursionist
28 6 7

This seems a bit more complicated - when you use "load more" button it will dynamicly pull the next page of products. Therefore you need to build some custom javascript to add the number of "next product sets" to the existing number of products shown on the page. Even a "load more" button will use pagination object. This seems like it needs more insights of your code etc. and some customizations based on how your "load more" button works. 

 

Feel free to send me more infos at mark@shopmate.cc and i can send you a quote for those changes. 

Thank you - Best regards,
crotastic.io

Problem Solved?✔️Like and Accept the solution that can help others.

Your ROAS sucks?
Visit www.crotastic.io and receive your free Conversion Rate Optimization Report today. We offer optimization and customizations of your Shopify Store.

Email: mark@crotastic.io
Shopify Custom Theme Development | Custom Store Modifications | Store Conversion Rate Optimization | Shopify App Development
0 Likes