More products to come / No products left in listing view
I am using ajax to implement a "Show More" button on my product listing page. It's a pretty simple implementation, I have my main shop page with this template:
perch_shop_products([ 'count' => $count, ]);
And a button which increments that count by a certain number, and sends it off to an ajax page with the same function, which then returns the results. Similar to the approach here: https://forum.grabaperch.com/forum/09-04-2014-loading-x-amount-of-shop-items-on-the-same-page-with-a-load-more-button
I would now like to hide my "Show More" button if there are no more products to show. I have tried to use
perch_item_last to apply a class for this, but it appears on the last item in the selected count, not the last item overall.
My question is can I add anything to the template which I can detect, which would indicate there are more products available beyond the count / no more products available beyond the count?