A merchant with 20,000 products and daily inventory fluctuations (~1,000 items) seeks to automatically move out-of-stock items to the end of collection pages, regardless of sorting or filters applied.
Current Status:
Shopify does not offer this as a built-in platform feature
Some third-party themes may include this functionality
Apps exist on the Shopify App Store that can handle this sorting
Technical Solution Provided:
A community member shared working Liquid code that:
Separates products into two arrays using the where filter: available and sold-out items
Renders available products first, followed by out-of-stock items
Includes specific implementation instructions for Shopify’s Dawn theme (modifying main-collection-product-grid.liquid)
Implementation Considerations:
The merchant uses a third-party paid theme (Ocolus), which may require adaptation of the provided code
One developer offered paid customization services ($35) to implement the solution
The basic logic involves filtering collection.products by the available property and rendering them in two separate loops
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
Hey there @Hrytsenko From my knowledge and research, there doesn’t seem to be an in-built Shopify feature that allows for automatically sorting the out of stock products at the end of the collection.
I’m sorry but this is complete nonsense, I have in my store 20 thousand products, and every day ± 1000 to be in stock or not.
I know that on all platforms there is such a solution that the goods that are in the status of out of stock fall to the end of the list on the storefront.
It’s just that shopify has not finalized it. But there are plugins for shopify that do it all. But as far as I understand there should be a small change in the code in collection.liquid.
So I want to know if anyone has already done it?
Hey @Hrytsenko . @Bundler-Manuel is correct Shopify for now does not have any settings from the customizer to make sold out products show at the last, some themes may have it but not Shopify as a platform.
Nevertheless I have done a project like this one before for a client and I know the logic behind it. Please see reference of client site below.
Okay so you are using a third party paid theme here.
Anyways if you wanted me to take care of this I would need Collab access unless you were on a free theme by Shopify.
It’s a paid one and I test stuffs out on a development store which doesn’t allow to edit third party themes.
I know the logic and how to work this out. I would also definitely need to look up a bit, but that won’t be that tough ,I can track it down.
So a coffe wouldn’t suffice it though, I do charge as per the project for my time and effort. So if you’re okay in $35, please reach out via personal links below for a convenient conversation and collaboration.