Shopify themes, liquid, logos, and UX
Hey everyone,
I was wondering how to remove the Sale button in my store. I'd like to have it removed from every page and keep the Sold out button.
Any help is greatly appreciated!
URL: https://glowee.nl/
Thank you.
Solved! Go to the solution
This is an accepted solution.
If you don't mind editing the code. To remove SALE from the Collection page; go to the Snippets folder and open the product-card.liquid file. Near the end of the code, comment out the line that displays the Sale label:
<div class="card__badge">
{%- if product_card_product.available == false -%}
<span class="badge badge--bottom-left color-{{ settings.sold_out_badge_color_scheme }}">{{ 'products.product.sold_out' | t }}</span>
{%- elsif product_card_product.compare_at_price > product_card_product.price and product_card_product.available -%}
{% comment %}
<span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span>
{% endcomment %}
{%- endif -%}
</div>
</div>
</div>
</div>
For the individual product page: open price.liquid in the Snippets folder. At the end of the code, comment out the line that displays the Sale label:
{%- if show_badges -%}
{% comment %}
<span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}" aria-hidden="true">
{{ 'products.product.on_sale' | t }}
</span>
{% endcomment %}
<span class="badge price__badge-sold-out color-{{ settings.sold_out_badge_color_scheme }}" aria-hidden="true">
{{ 'products.product.sold_out' | t }}
</span>
{%- endif -%}
</div>
This is an accepted solution.
Ok, just try copying the original code from above. You can use the {% comment %} and {% endcomment %} liquid tags. That will hide all the code in between.
{% comment %} <span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span> {% endcomment %} {%- endif -%}
This is an accepted solution.
If you don't mind editing the code. To remove SALE from the Collection page; go to the Snippets folder and open the product-card.liquid file. Near the end of the code, comment out the line that displays the Sale label:
<div class="card__badge">
{%- if product_card_product.available == false -%}
<span class="badge badge--bottom-left color-{{ settings.sold_out_badge_color_scheme }}">{{ 'products.product.sold_out' | t }}</span>
{%- elsif product_card_product.compare_at_price > product_card_product.price and product_card_product.available -%}
{% comment %}
<span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span>
{% endcomment %}
{%- endif -%}
</div>
</div>
</div>
</div>
For the individual product page: open price.liquid in the Snippets folder. At the end of the code, comment out the line that displays the Sale label:
{%- if show_badges -%}
{% comment %}
<span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}" aria-hidden="true">
{{ 'products.product.on_sale' | t }}
</span>
{% endcomment %}
<span class="badge price__badge-sold-out color-{{ settings.sold_out_badge_color_scheme }}" aria-hidden="true">
{{ 'products.product.sold_out' | t }}
</span>
{%- endif -%}
</div>
Thank you so much @Alan15
However, this removed the Sold out button as well, which I would like to keep. Is there any way to only remove the Sale button?
Thank you!
You were right, the code is correct. I commented out the whole code which caused both buttons to vanish. I'm sorry about that.
I've now bumped into a new problem, which is the ''-->'' text appearing next the Sold out button caused by commenting out the line of code;
the edited code;
<div class="card__badge">
{%- if product_card_product.available == false -%}
<span class="badge badge--bottom-left color-{{ settings.sold_out_badge_color_scheme }}">{{ 'products.product.sold_out' | t }}</span>
{%- elsif product_card_product.compare_at_price > product_card_product.price and product_card_product.available -%}
<!-- <span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span>
{%- endif -%} -->
</div>
</div>
</div>
</div>
Did I properly comment out the line?
Thank you again!
I think the closing --> needs to go before the {% endif %}
I moved the closing --> and it caused this unfortunately;
This is an accepted solution.
Ok, just try copying the original code from above. You can use the {% comment %} and {% endcomment %} liquid tags. That will hide all the code in between.
{% comment %} <span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span> {% endcomment %} {%- endif -%}
Sweet, this worked perfectly! Thank you so much!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024