Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Any workarounds or suggestions would be wonderful!
We have several collections on our site.. for just 1 of the collections, I'd like to only show items that have >1 quantity in stock if quantity goes to zero, the product would not show.
Alternatively, if the above is not possible, is it possible to just sort the 1 category by Quantity amount?
Any suggestions?
Thank you!
Hello,
That's certainly possible! There are two ways to achieve this:
1. Via Javascript
1.a. Check if this is the collection that you want to filter;
1.b. If so, pass a HTML data-attribute with the amount with of product to the respective collection items
1.c. Sort it using ES6's sort function
2. Via .liquid using the sort filter
Feel free to e-mail me if you need further help!
Yes, the Dynasort app will do this automatically. There's a demo plan that let's you do this for free. Here's a little tutorial video on how to set it up:
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025