Collection page - out of stock products

Hi,
Has anyone found a solution for omitting out-of-stock products from the collections page? I can’t unpublish products because links to them need to be active so they can be accessed directly from a link or Google. I also can’t currently use automatic collections because collections are created in PIM and we use manual collections.

The Liquid conditions will mess up pagination, and adding a filter after the page loads is also a poor solution. Has anyone solved this problem? Perhaps a backend solution? Shopify functions or something else will help?

As of today, there are only imperfect ways to manage out-of-stock products on the collection pages. As you are using a PIM and manual collections, I would say your best bet would be to implement a system that periodically reorders the products in the collection according to their status:

  • If the product is out-of-stock, you push it at the bottom of the collection
  • If the product is available again, you push it back in place

Surely, there are already available apps that perform this kind of operations. Just check that it does not conflict with your PIM and processes. That’s your best bet, there are no better solutions using Liquid, good luck with that!

@teamdijon Thank you for your reply. We currently use an app that sorts out-of-stock products at the end of the collection, but it’s not an ideal solution for our client – ​​he wants them to disappear completely from the collection page but remain active for Google. However, as I see, there’s currently no solution for this – which is a weak. Perhaps it would be worth considering as a feature to implement - @Liam-Shopify .

We’re talking to the client about switching to smart collections to fix this issue, but it’s a significant process due to the large number of collections, URLs, etc.

You could have the following architecture:

  • The /collections/all collection that would remain untouched and contain all products, making sure that every product is active and accessible for Google no matter what.
  • The specialized collections, from which you would remove the out-of-stock products (instead of pushing them at the bottom).

I’m an advocate for smart collections but it seems you can just alter the current system you have to remove instead of switching product positions :wink:

If your collections are manual, then you may consider using, say, Flow to remove sold-out products from these collections?

This should not be a complex flow…