Hide discount badge when product is sold out

Topic summary

Issue: On the Prestige theme’s sale collection page, sold‑out items displayed both a “Back soon” stock badge and a discount badge. Goal: when a product is out of stock, show only the “Back soon” label and hide the discount badge.

Attempts:

  • Initial request for store access details to inspect the issue.
  • First fix suggested adding a Liquid condition in theme.liquid (Shopify’s main layout file) above the tag using product.available, but the result did not behave as intended per the merchant.

Resolution:

  • An alternative approach was provided: add custom code under the section of theme.liquid. The merchant confirmed this solution worked and achieved the desired behavior.

Outcome/Status:

  • Resolved. The discount badge is now hidden for sold‑out products on the collection page, leaving only the “Back soon” label visible.
  • No further action items or open questions noted.

Notes:

  • A screenshot illustrating both badges was shared but not required to implement the fix.
Summarized with AI on January 7. AI used: gpt-5.

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