Changing the position of Discount Badge in Product

Please Help!

I want to swap the position of my discount badge and product price in my product page. See the photo for reference.

Hi, @IntechCarl

please send page url

Hi! This current theme is not published yet it is in development, will you be able to see it if I send you a preview link for this theme?

okay send me preview link

https://thecleanroom.net/?_ab=0&_fd=0&_sc=1
Here, I’m not sure if you can see the unpublished theme.

btw, this unpublished theme that I need help with is dawn. The current theme in used is debut.

please send me page url which you want to fixed the image you gave to me i will give you a code you have to place this code only

i can’t find the image that you show to me which problem you have to solve by me please send exit page url

Hi @IntechCarl

To share preview of unpublish theme, you must get link at the right bottom color after clicking Preview

Great! Thank you!

https://ceb61zjhq3fwx750-13830324282.shopifypreview.com
here is the shared preview link. I hope this works.

Go to your Online store > Themes > Edit code > Assets, open base.css file and add this code at the bottom:

.product__info-wrapper .price {
display: flex;
flex-direction: column-reverse;
}
.product__info-wrapper .price .badge.price__badge-sale.color-accent-2{
    width: fit-content;
}

Thank you Dan! This one works!

Btw, is may I ask for your help again for another concer?
Is it possible to add another badge that shows the save amount in discount? I want to add it besides the discount percentage. See the photo for reference.

You can try to use this code

{%- assign savings = product.compare_at_price | minus: product.price  -%}
Save {{ savings | money_without_trailing_zeros | money_with_currency }}

where should I put this code?

Go to your Online store > Themes > Edit code > price.liquid file, add it next to % off code

here?

IntechCarl_0-1700035819428.png

If you want it appear in % off then paste code after “Off”. If you want it appear to new badge, please add code like this right after {%- if show_bages -%} code


{%- assign savings = product.compare_at_price | minus: product.price  -%}
Save {{ savings | money_without_trailing_zeros | money_with_currency }}

This Actually works, But it shows 0 amount of savings even if the product is on sale

Please try to update code to this version

{%- assign savings = product.compare_at_price | minus: product.price  -%}
Save {{ savings | money_without_trailing_zeros }}