Does anyone know how I can display the number of items on the page I am looking at?
I only know how to display the total number of items, using {{ paginate.items }}
My goal is to display the following message…
"Showing 1 to 8 products from 100" and have this update each time you go to the next page…
"Showing 9 to 16 products from 100"…
<div>
<p class="text-sm text-gray-700">
Showing
<span class="font-medium">{{ what goes here? }}</span>
to
<span class="font-medium">{{ what goes here? }}</span>
products from
<span class="font-medium">{{ paginate.items }}</span>
</p>
</div>
2
Answers
Thank you. I have figured something out but it doesn't work for the last page because the page has less than {{ paginate.page_size }}.
{{ paginate.page_size }} is the max number of products the page can hold, rather than the actual number of products the page is holding. How can I get the latter?
Here’s should be the correct version