Creating a "Sold out" Filter

Arvind_Rajkumar
Tourist
9 0 3

Hi..

One of the constant complaints we get from our buyers is that a sizeable part of our collections get sold out on the launch day. So I am looking to incorporate a SOLD OUT Filter on top of the collection page. I will be very grateful if some one can help me out with the liquid code for this.

Thanks in Advance.

Arvind

Life is the Art of drawing without an Eraser !
0 Likes
vix
Shopify Staff
Shopify Staff
535 105 109

Hi Arvind!

Victoria here from the Guru team! 

That is completely do-able! There are a few ways of setting this up. The easiest way to set this up would not require a liquid code customization. You can create an automatic collection for when the inventory of a product is 0. This collection will be hidden and therefore, your sold out products will not appear on your page. We have a great tutorial on how to hide these sold out products. 

You can find the link here: https://docs.shopify.com/support/your-store/products/can-i-hide-products-when-they-are-out-of-stock

The next option would be through the use of apps. An app like Zero Out will automatically hide these sold out products for you. 

Have a look at the first tutorial and let us know if you need any more guidance, 

Victoria - Shopify Guru

Support@shopify.com

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Arvind_Rajkumar
Tourist
9 0 3

Dear Victoria..

Thank you for the pointers..

But I am specifically looking for a pull down filter option for our visitors, if they want to browse only the 'available' items..

We don't want to hide the "Sold out" products altogether..  For our store, the sold out tags on the products are at times the purchase trigger for many visitors.

Hope I have explained that clearly..  Pls help..

Best Regards

Life is the Art of drawing without an Eraser !
0 Likes
vix
Shopify Staff
Shopify Staff
535 105 109

Hey Arvind, 

Okay I understand :) If you want to display your sold out variants you could always create an entire collection for your sold out products and display these for marketing. You can set the conditions of the collection to read: 

This would allow you to have a visible collection of sold out products but have them be able to click on a new collection of available products to filter these out. To create a filter on your page specifically for inventory would be a lot of custom work. It may be best to reach out to a Shopify Expert for this type of customization. 

Alternately, you could tag your sold out products and filter by product tag or look into using a filter app such as Power Tools. This app can be found here: https://apps.shopify.com/shopify-power-tools-suite

Hope that helps :) 

Victoria 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Travnape
Excursionist
19 0 6

This doesn't actually work. Shopify's "0 inventory" filter is stupid and will show any product that has ANY variant with 0 on hand. So you could have 1000 in stock of one variant and 0 of another and it will show on your out of stock collection.

Peter_Peng
Shopify Partner
10 0 0

Travnape is right, the simple conditional logic in shopify collection building section, though powerful, does not work for larger stores.

Besides the downfall of variants & the logic as mentioned earlier, there also needs to be nested "any" / "all" logic that allows for more specific auto-collections.  Otherwise it's a manual data entry mess of tags and imagine doing that for 5000+ products.

0 Likes
Travnape
Excursionist
19 0 6

Yes, in addition to an if/or logic they also need a negative qualifier logic !=

 

ex:

Item has inventory greater than 0

and

Item has Tag X

and

Item DOES NOT have Tag Y

0 Likes
Peter_Peng
Shopify Partner
10 0 0
Hmm well I think the problem is that tags need manual work, so placing auto
stuff based on manual tags just add more complex manual layers.

So for small stores it’s fine but scaling up to 200+ skus and anything
based on TAGS will clog your store down to the point of hiring manual
labourers, so.., I guess that works?
0 Likes