Hi,
I’m building an affiliate site, so on the product page I’m using outlink to direct visitors to another website, but on the collection page, it will show as sold out because the quantity is zero. How can I remove that badge?
Hi,
I’m building an affiliate site, so on the product page I’m using outlink to direct visitors to another website, but on the collection page, it will show as sold out because the quantity is zero. How can I remove that badge?
Hello There,
Please share your store URL and password.
So that I will check and let you know the exact solution here.
To remove the “sold out” badge from the collection page in Shopify, you can follow these steps:
{% if product.available %}
{% comment %}Code for displaying available products{% endcomment %}
{% else %}
<span class="sold-out-badge">Sold Out</span>
{% endif %}
{% comment %} and {% endcomment %} tags like this:{% comment %}
{% if product.available %}
{% comment %}Code for displaying available products{% endcomment %}
{% else %}
<span class="sold-out-badge">Sold Out</span>
{% endif %}
{% endcomment %}
Please note that modifying the theme code requires some technical knowledge. If you are not familiar with editing code, it’s recommended to reach out to a Shopify expert or developer for assistance. Additionally, make sure to create a backup of your theme files before making any modifications.
@bugoutgears - can you please share your page link where you have this badge? it will need css
Hi @bugoutgears ,
Can you share your store url
Locate the code that generates the product listing in the collection loop. This code will vary depending on your theme, but it should be within a {% for product in collection.products %} loop.
Look for the code that displays the “sold out” badge or any related indicators. It might be a conditional statement that checks the product’s inventory quantity.
Add a conditional statement around the code that displays the “sold out” badge to exclude products that are intended as affiliate links. You can use a tag or metafield to identify these products. For example:
{% if product.metafields.custom.is_affiliate_link != true %}
{% endif %}
Replace product.metafields.custom.is_affiliate_link with the appropriate metafield or tag used to identify affiliate link products in your store.
Hello @bugoutgears
Could you please provide your store URL and, if it is password protected, please share the password so I can review it and provide a solution?
Hi All,
As an alternative solution at customize of your theme go to section where those appear and add this at Custom CSS:
.badge {
display: none;
}
It worked for me very well for a collection that was being displayed on frontpage.
Cheers,
Goncalo