Hiding the "sold Out" badge on certain collections and /or products - Empire theme

Hiding the "sold Out" badge on certain collections and /or products - Empire theme

ME4295
Tourist
5 0 4

Hi, 

 

Please help - I've tried all sorts of things and I'm not achieving what I want. 

 

I'd like to hide the "sold out" badge for certain collection and/or products (as in the picture - the yellow arrow is pointing to it) 

 

Please help!!!

 

 

image (1).jpeg

 

Replies 5 (5)

emmax_digits
Shopify Partner
2 1 0

To hide the "Sold Out" badge for specific products or collections:

Go to Theme > Edit Code, find the badge code (usually in product-card.liquid), and wrap it like this:

{% unless product.handle == 'your-product-handle' %}
  {% if product.available == false %}
    <span class="badge sold-out">Sold Out</span>
  {% endif %}
{% endunless %}

Replace 'your-product-handle' with the actual product handle. Save and you're done.

ME4295
Tourist
5 0 4

Hello there, 

 

Thank you for this - but it hides the "coming soon badge and not the "sold out" badge. 

 

Is there anything else that can be tried?

 

dhimansangeeta
Tourist
11 0 1

hello @ME4295 


Hide "Sold Out" badge for specific collections:--
Step 1: Identify the file showing the badge
Typically, this badge is rendered in:

product-card.liquid
or sometimes:

product-grid-item.liquid

Go to Online Store ...> Themes ...> Edit code and search for the file that renders the product grid.

Step 2: Find the "Sold Out" badge code
Look for something like:

{% if product.available == false %}
  <div class="badge badge--sold-out">Sold Out</div>
{% endif %}

Step 3: Add a collection condition
Wrap it with a condition to exclude specific collections. Example:

{% unless collection.handle == 'hidden-collection-handle' %}
  {% if product.available == false %}
    <div class="badge badge--sold-out">Sold Out</div>
  {% endif %}
{% endunless %}

Replace 'hidden-collection-handle' with your collection's handle (from the URL slug).

if its works please accept my solution

thanks

Was I helpful?

Buy me a coffee


APPS BY US :

Professional Customer Accounts APP


Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -sangeetarahuldhiman@gmail.com - : -Whatsapp: +917009811712
Checkout Some Free Sections Here

devcoders
Shopify Partner
1444 172 450

Hello @ME4295 
Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.

Shopify Developer: Helping eCommerce Stores
If you need assistance with your store, feel free to contact us at devcodersp@gmail.com
WhatsApp No: +91 8516919310 If my assistance was helpful, please consider liking and accepting the solution. Thank you!