Hide discount badge when product is sold out

Hi all,

I was wondering if you could maybe help me out with something.

We are using the Prestige theme and we are very happy with it. One thing that is bothering us, is the on the sale collection page when an item goes out of stock it shows both labels. We don’t like the way this looks and is a bit confusing towards our customers.

I have tried somethings with coding, but I can’t get it to work.

What we want to see is that when a product goes out of stock it will only show the back soon label and not show the discount label anymore.

Is there someone who can help us out with this? :hugs:

Hey @sebash

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

Best Regards,
Moeed

Hi Moeed,

Thanks for the quick reply!

Hey @sebash

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag

{% if product.available %}

{% else %}

{% endif %}

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

Hi @sebash

Go to Online store > Themes > Edit cod > open theme.liquid file, add this code under element


Great, thank you so much! It worked

1 Like

Hi,

This sadly didn’t work. This did it the way around, so back soon was showing but the discount wasn’t.

Below I got a reply with the working solution, thanks anyways!!

Happy I could help