Liquid, JavaScript, themes, sales channels
Does anyone know how to modify the pagination function to include only certain products.
For example let's take the following code:
{% paginate collection.products by 16 %}
If I then want to only include available products by adding
{% unless product.available %}
in the for loop I have the problem that 16 products have already been parsed and now you're cutting them out of the loop, so maybe only 14 will show on that page, even though the pagination will indicate 16. Therefore I need to somehow redefine 'collection.products' in the initial paginate function to paginate only the kind of products i want. Does anyone have an example of this?
Thanks
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024