Hide out of stock variants for size/color options

Robert_Behnke
New Member
3 0 0

Hello,

I have a handle that has several colors that are seasonal. So during part of the year (when some colors are sold out) i would like those color options not to show on the product page. 

I have successfully added code from this solution:

https://help.shopify.com/en/themes/customization/products/variants/hide-variants-that-are-sold-out

But that only works on products with one option (it works perfectly on my products with color only). But on products with 2 options (color and size) that does not work. 

Any solutions to hide variants in handles that have two options? 

0 Likes
Don
Shopify Staff
Shopify Staff
1222 73 156

Hi there Robert!

Don here from Shopify. :)

We can take a look at putting this in place internally for your store, though I will just need to reach out to you via email first so this can happen.

I will send a mail to the address we have on file for you here so we can get this started.

All the best!


Regards,
Don

Don | Social Care @ 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 the Shopify Help Center or the Shopify Blog

Edward_Huai
New Member
5 0 0

Hi Don – Would you be able to take a look at our account too? I'm looking to implement this code as well. Thank you : )

0 Likes
Jessica_Littlef
New Member
3 0 2

Hi Don can you get in contact with us too....i have seen many threads like this over the past 2+ years....any reason its not built in out of the box?

0 Likes
Peter667
New Member
3 0 0
Hi Don,

could you please make that work for me too? or could you provide the code for minimal theme?

regards
0 Likes
Joyce_G_Cedillo
Shopify Expert
30 0 6

You can add a if condition in your product-template.liquid file to show items in dropdown only when variant is available. However this doesn't work if you have 2 or 3 types of variants. example:
Color and Size
or
Color, Size and Material

You will need a JS logic, which can get tricky based on theme you are using. 
Also, you will need to think if all products go out of stock, what you want to happen?

 

You can also try out this app:https://apps.shopify.com/autohide-soldout-products

Which can hide out of stock variants, and hide entire product when all the variants of products are out of stock. 

0 Likes
morganmillah
New Member
1 0 1

Hello, Could you please take a look at our account as well?  Thank you so much Don!

Hi Don, I need assistance with hiding out of stock variants on my store as well please. Using the minimal theme. 

0 Likes
CaseyJK44
New Member
1 0 0

Hi Don! I've also been searching for this solution, with no luck! Any chance you can contact me as well at caseyjonesdesigns@gmail.com?

0 Likes
Hi Casey, Jasoliya (Shopify expert) jasoliyabrijesh123@gmail.com, was able
to assist with the necessary code to my store to achieve hiding to sold out
variants. Get in touch with him for help on this.
0 Likes