What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Removing the Sale button on Dawn

Solved

How do I remove the Sale button from every page on Dawn?

Dike
Pathfinder
105 1 41

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.

Accepted Solutions (2)

Alan15
Shopify Partner
148 27 72

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>

 

 

Need more help? Contact me here

View solution in original post

Alan15
Shopify Partner
148 27 72

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 -%}

 

Need more help? Contact me here

View solution in original post

Replies 8 (8)

Alan15
Shopify Partner
148 27 72

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>

 

 

Need more help? Contact me here
Dike
Pathfinder
105 1 41

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!

Alan15
Shopify Partner
148 27 72

Hi @Dike 

This is working for me, the Sold Out label still shows. Make sure you have only commented out the On Sale code. Otherwise I'm not sure; maybe you have already made some other customizations that are affecting things?

Need more help? Contact me here
Dike
Pathfinder
105 1 41

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;


Screen Shot 2021-12-10 at 10.52.48.png


 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!

Alan15
Shopify Partner
148 27 72

I think the closing --> needs to go before the {% endif %}

Need more help? Contact me here
Dike
Pathfinder
105 1 41

I moved the closing --> and it caused this unfortunately;

 

Screen Shot 2021-12-10 at 11.04.26.png

Alan15
Shopify Partner
148 27 72

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 -%}

 

Need more help? Contact me here
Dike
Pathfinder
105 1 41

Sweet, this worked perfectly! Thank you so much!