Missing sale badge on product cards (collection) and product details in the Dawn template.

Hi,

I’ve been searching through the questions here and testing a few options and solutions, but none of them seem to be working for me

Im testing it on a single product

https://misskolorova.com/products/amplia

Ive got the hide price comparison for EU turned off

For the collection card (when you add a standard collection), there’s no badge showing on the bottom left?

if you’re comfortable editing code, open the file “card-product.liquid” and share the lines 123-139.
they should look something like this:


            {%- if card_product.available == false -%}
              
                {{- 'products.product.sold_out' | t -}}
              
            {%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}
              
                {{- 'products.product.on_sale' | t -}}
              
            {%- endif -%}
          

If you’re not comfortable with the code, feel free to send me a message and I’m happy to take a look.

only badge that shows up is the “sold out”
the “sale” badge is missing

code


{%- if card_product.available == false -%}

{{- 'products.product.sold_out' | t -}}

{%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}

{{- 'products.product.on_sale' | t -}}

{%- endif -%}

There’s a rule where the Sale badge should only show when the product is not sold out.
Does adding inventory make the badge appear? The code for it is there.

lol, seems it works

googled a ton, read this forum but no sign of such a condition.

you are God :grinning_face_with_smiling_eyes:

x hours wasted, such a simple solution.

thank you. sorry about this silly situation

Happens to the best of us. Glad it works :slightly_smiling_face: