Liquid, JavaScript, themes, sales channels
Hi,
I understand that one can change the number of products listed _per page_ via pagination. However, is there a way to specify the total number of pages?
My use case is as follows.
I want to create a 'New' collection that only shows products from the last 30 days. Creating this collection on the backend and ordering it by date is easy enough. On the Liquid side, I can compare the creation date to today's date and not show the product if it's older than 30 days. Unfortunately, the pagination does not take this filtering into account.
I was thinking to run a separate loop at the top (before pagination) to determine how many products in the collection fit within this threshold, and then specify that limit on the pagination call. But I cannot find any syntax for this in pagination. Is there a method to do this? Or am I just stuck having to omit pagination on this type of page? Or are there any other strategies you're all using?
Thank you
User | RANK |
---|---|
25 | |
21 | |
8 | |
7 | |
6 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023