How do I display a sold out message next to a product in the dropdown when using multiple variants?

Highlighted
Excursionist
12 0 6

Hi there,

I'm using the Debut theme on my Shopify store. When a variant of a product is sold out the customer would currently have to select the product to see that it is sold out, however I would like to be able to put a note next to the variant in the drop down that says (sold out).

Does anyone know how to do this?

Thanks in advance.

0 Likes
Highlighted
Excursionist
32 4 9

Hey @Magpie2212, this should be simple enough, but you'll likely need to edit your theme code. Somewhere there will be a loop of `{% for variant in product.variants %}`. As you describe, there's a dropdown, so the HTML for each option is probably in this `{% for %}` loop, and somewhere you'll see something like `{{ variant.title }}`. You can then use `{{ variant.available }}` to check whether it's available or not and add a class or text to disallow the user selecting this dropdown option.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
737 39 123

Hey, @Magpie2212.

My name is Tira and I am here to help. Thanks @JØhn for chiming in with your suggestion.

We have a guide on how you can hide your sold out variants so that they appeared greyed out and aren't clickable for the customer. Here's an example of what this looks like:

15-33-1n3mh-yxeim

If you're looking to do something similar, you could use our tutorial on hiding sold out variants

I can also look into whether our design team can help you with this customization. Please let me know if you would like us to help.

Talk soon,

Tira | 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

Highlighted
Excursionist
12 0 6

Hi @Tira,

Thanks for your response. I did read this tutorial, however I have more than one option per product so this will not work for me.

Thanks

0 Likes
Highlighted
Shopify Staff
Shopify Staff
737 39 123

Thanks for confirming, @Magpie2212. If you're looking to mark multiple product options as sold out, I would recommend hiring a Shopify Expert to assist. Shopify Experts specialize in coding customizations that help you build your business. You can find a list of them here in our Experts Marketplace

I am also curious to hear what the community suggests! 

Tira | 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

0 Likes