All things Shopify and commerce
How can I prioritize sorting In Stock products first and Out of Stock Items last in collections, without using a third-party app?
I’m trying to achieve this through custom coding in Liquid. I’ve successfully created two different arrays for products in stock and out of stock. However, when I render these arrays on Shopify, they only sort within the same page.
For instance, on page 3, the top of the page is filled with In Stock items, while the bottom is filled with Out of Stock items. This pattern repeats on pages 4, 5, and all others. Essentially, Shopify only sorts within the same page.
As far as I understand, Shopify doesn’t allow paginating modified arrays. Has anyone been able to figure out a solution to this sorting type?
Hello @CMET ,
Yes you are right this thing is possible with pagination. btw if you still need this the only possible way is lode more concept, where every time you need to insert the in stock product before out of stock using Javascript.
Regards
Guleria
Hi @CMET research prior topics on custom sorting in liquid, with/without "algorithm" , TQ&A subforum tends to be better.
without using a third-party app it breaks down to:
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025