Changing placement of sale badge next to product price (compare-at-price)

Solved

Changing placement of sale badge next to product price (compare-at-price)

ecorushmotors
Tourist
4 0 2

So I'm having an issue with the placement of the "Sale" badge next to the product price. 

At the moment it looks like this:

Screenshot 2024-09-02 190801.png

 

It's way too close to the product price and is not aligned with the product price, instead I would like it to look like this:

Screenshot 2024-09-02 190717.png (i used photoshop to showcase how I want it)

 

I would really appreciate any kind of help on this, thank you! 🙂

Accepted Solution (1)
Made4uo-Ribe
Shopify Partner
10038 2387 3014

This is an accepted solution.

Please, repaste for the code below. 

 

.price>* {
    display: inline-block;
    vertical-align: middle !important;
}
.product .price .badge, .product .price__container {
    margin-bottom: 0 !important;
    margin-right: 10px;
}

 

And Save. 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

View solution in original post

Replies 7 (7)

Made4uo-Ribe
Shopify Partner
10038 2387 3014

Hi @ecorushmotors 

Would you mind sharing your store URL? Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
ecorushmotors
Tourist
4 0 2

Aurephine.com

Made4uo-Ribe
Shopify Partner
10038 2387 3014

Thanks for the info, check this one.

From you Admin page, go to Online Store > Themes

Select the theme you want to edit

Under the Asset folder, open the main.css(base.css, style.css or theme.css)

Then place the code below at the very bottom of the file.

 

.price>* {
    display: inline-block;
    vertical-align: middle;
}
.product .price .badge, .product .price__container {
    margin-bottom: 0;
    margin-right: 10px;
}

 

And save. 

Result:

Made4uoRibe_0-1725298645634.png

 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
ecorushmotors
Tourist
4 0 2

You absolute legend, thank you so much. I copy pasted it into the base.css file under the assets tab, now it further away from the product price but for some reason it's still pretty far up. Any ideas?Screenshot 2024-09-02 194255.pngScreenshot 2024-09-02 194322.png

Made4uo-Ribe
Shopify Partner
10038 2387 3014

This is an accepted solution.

Please, repaste for the code below. 

 

.price>* {
    display: inline-block;
    vertical-align: middle !important;
}
.product .price .badge, .product .price__container {
    margin-bottom: 0 !important;
    margin-right: 10px;
}

 

And Save. 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
ecorushmotors
Tourist
4 0 2

Amazing, much love to you man thanks. I sent you a little coffee tip on paypal 🙂

Made4uo-Ribe
Shopify Partner
10038 2387 3014

Thank you, and you're welcome!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.