Shopify themes, liquid, logos, and UX
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!!!
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.
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?
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
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.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025