Shopify themes, liquid, logos, and UX
I am trying to hide the sale badge on the collection and product pages when the customer tag is "wholesale". My theme is Dawn.
I have tried editing the code many different ways with no success. I have previously edited this section to change the format of the sale badge in snippets -> card-product.liquid
I do still need the sold out badge to appear.
Any help would be appreciated, thank you!
Sydney
Solved! Go to the solution
This is an accepted solution.
{% if customer %}
{% assign is_wholesale = false %}
{% for tag in customer.tags %}
{% if tag == 'wholesale' %}
{% assign is_wholesale = true %}
{% endif %}
{% endfor %}
{% endif %}
{% unless is_wholesale %}
// Highlighted code in screen-shot goes here.
{% endunless %}
If you need further help don't hesitate to contact me.
You can find the email in the signature below.
Thanks
This is an accepted solution.
For anyone needing to remove the badge from the product page as well, I just copied the above code into snippets/price.liquid and formatted it around line 36.
This is an accepted solution.
{% if customer %}
{% assign is_wholesale = false %}
{% for tag in customer.tags %}
{% if tag == 'wholesale' %}
{% assign is_wholesale = true %}
{% endif %}
{% endfor %}
{% endif %}
{% unless is_wholesale %}
// Highlighted code in screen-shot goes here.
{% endunless %}
If you need further help don't hesitate to contact me.
You can find the email in the signature below.
Thanks
Thank you, this worked for me! But only on the collection page, I am still seeing the badge on the product page.
This is an accepted solution.
For anyone needing to remove the badge from the product page as well, I just copied the above code into snippets/price.liquid and formatted it around line 36.
You can try to update that code to this version and check
{%- if card_product.available == false -%}
<span
id="NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}"
class="badge badge--bottom-left color-{{ settings.sold_out_badge_color_scheme }}"
>
{{- 'products.product.sold_out' | t -}}
</span>
{%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}
{% if customer %}
{% assign wholesale_tag = false %}
{% for tag in customer.tags %}
{% if tag == 'wholesale' %}
{% assign wholesale_tag = true %}
{% endif %}
{% endfor %}
{% if wholesale_tag %}
<span
id="NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}"
class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}"
>
{{- 'products.product.on_sale' | t -}}
</span>
{%- endif -%}
{%- endif -%}
{%- endif -%}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025