Modify sale badge with price and discount % Dawn 15V

Solved

Modify sale badge with price and discount % Dawn 15V

ctal37
Explorer
151 1 36

hiii

I would like to change my sale badge into brand Zara's sale badge. In Zara's sale badge it shows product discount % and product price right inside the badge only I want that kinda badge which shows product discount % and product price after discount inside the badge.

Please check screenshot of Zara's badge : 

store url : https://5a3cf5-fc.myshopify.com/products/rhinestoneWhatsApp Image 2024-09-10 at 10.48.50.jpeg

Accepted Solutions (5)

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 ,

Step 1. Go to Admin -> Online store -> Theme > Edit code

Step 2. Find the file price.liquid.

Step 3. Find and remove the code i've marked here

BSSCommerceB2B_0-1725950654279.png

Step 4: Find and replace the following code snippets

BSSCommerceB2B_1-1725950707793.png

by this

 <span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}">
      {% assign discount = compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round %}
      -{{ discount }}%
      &nbsp;
      <span class="price-item--sale price-item--last">
        {{ money_price }}
      </span>
    </span>

It will look like this

BSSCommerceB2B_3-1725950860913.png

Step 5: Save it

Hope it helps 😊

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 , Please follow these steps again:

Step 1. Go to Admin -> Online store -> Theme > Edit code

Step 2. Find the file price.liquid.

Step 3. Find and replace the code i've marked here

BSSCommerceB2B_2-1725961038082.png

by

 

<span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}">
      {% assign discount = compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round %}
      -{{ discount }}%
      &nbsp;
      <span class="price-item--sale price-item--last">
        {{ money_price }}
      </span>
    </span>

 

Step 4: Remove this one 

BSSCommerceB2B_1-1725960969163.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37, I don't think it can fit in a row on small devices because it's too long. You can remove this to reduce the width of the custom element I gave you earlier.

BSSCommerceB2B_0-1725975149837.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 ,

Step 1: Remove this one on the previous code i've commented before

BSSCommerceB2B_0-1725978539637.png

Step 2: Add this code before </body> in theme.liquid

<style>
.price__sale .price-item--regular {
  margin: 0 0.5rem 0 0!important;
}
.price__sale .price-item--sale {
  padding: 2px!important;
}
</style>

Result:

BSSCommerceB2B_1-1725978980508.png

If it helps you, please like and mark it as the solution.

Best Regards  😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37, change the code like this

<style>
@media only screen and (max-width: 768px) {
  .card-information .price__sale .price-item--regular {
  margin: 0 0.5rem 0 0!important;
}
.card-information .price__sale .price-item--sale {
  padding: 2px!important;
}
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

Replies 13 (13)

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 ,

Step 1. Go to Admin -> Online store -> Theme > Edit code

Step 2. Find the file price.liquid.

Step 3. Find and remove the code i've marked here

BSSCommerceB2B_0-1725950654279.png

Step 4: Find and replace the following code snippets

BSSCommerceB2B_1-1725950707793.png

by this

 <span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}">
      {% assign discount = compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round %}
      -{{ discount }}%
      &nbsp;
      <span class="price-item--sale price-item--last">
        {{ money_price }}
      </span>
    </span>

It will look like this

BSSCommerceB2B_3-1725950860913.png

Step 5: Save it

Hope it helps 😊

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

hey @BSSCommerce-B2B  there is a issue. this code is making the badge visible only inside the product page but there is no badge showing on homepage product and also how do I change discount % on badge. please Screenshot 2024-09-10 at 2.19.05 PM.pngcheck screenshot 

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 , Please follow these steps again:

Step 1. Go to Admin -> Online store -> Theme > Edit code

Step 2. Find the file price.liquid.

Step 3. Find and replace the code i've marked here

BSSCommerceB2B_2-1725961038082.png

by

 

<span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}">
      {% assign discount = compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round %}
      -{{ discount }}%
      &nbsp;
      <span class="price-item--sale price-item--last">
        {{ money_price }}
      </span>
    </span>

 

Step 4: Remove this one 

BSSCommerceB2B_1-1725960969163.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

@BSSCommerce-B2B now another issue, I changed the sale badge colour to pink but on home page it is still in black colour. how do I change the colour please Screenshot 2024-09-10 at 3.08.23 PM.pngcheck screenshot.

BSSCommerce-B2B
Shopify Partner
1739 523 584

Sorry for the late reply. Did you hide it? I can't see it anymore.

BSSCommerceB2B_0-1725973265488.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

yes I've hide it.  look the discount badge is going down in few mobile view and when I try decreasing the font and other sizes to fit it in the same row then it looking so small . please helpWhatsApp Image 2024-09-10 at 18.11.25 (1).jpegWhatsApp Image 2024-09-10 at 18.11.25.jpeg

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37, I don't think it can fit in a row on small devices because it's too long. You can remove this to reduce the width of the custom element I gave you earlier.

BSSCommerceB2B_0-1725975149837.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

@BSSCommerce-B2B hey it is possible check how Zara showcasing all the prices and still have space right after the badge. check screenshot and try helping. if it doesn't fit in a row thn no use of this badge. so please helpWhatsApp Image 2024-09-10 at 10.48.50.jpeg

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37 ,

Step 1: Remove this one on the previous code i've commented before

BSSCommerceB2B_0-1725978539637.png

Step 2: Add this code before </body> in theme.liquid

<style>
.price__sale .price-item--regular {
  margin: 0 0.5rem 0 0!important;
}
.price__sale .price-item--sale {
  padding: 2px!important;
}
</style>

Result:

BSSCommerceB2B_1-1725978980508.png

If it helps you, please like and mark it as the solution.

Best Regards  😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

hey it worked but look this code is decreasing the size of the badge even inside the product page but I don't want to decrease the size of the badge in here. check screenshot pleaseWhatsApp Image 2024-09-10 at 20.50.04.jpeg

BSSCommerce-B2B
Shopify Partner
1739 523 584

This is an accepted solution.

@ctal37, change the code like this

<style>
@media only screen and (max-width: 768px) {
  .card-information .price__sale .price-item--regular {
  margin: 0 0.5rem 0 0!important;
}
.card-information .price__sale .price-item--sale {
  padding: 2px!important;
}
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

ctal37
Explorer
151 1 36

not changing anything still the same 😞

Amanda_Fordeer
Shopify Partner
112 8 29

Hi @ctal37,

You can refer to the Product Labels & Badges app to customize badges according to your preferences with our new Price Badges feature.

Amanda_Fordeer_0-1725961644695.png

Prices shown in the image are for illustration purposes only.

 
If you find my suggestion helpful, please give it a like or mark it as a solution!
And discover more approaches to:
Streamline invoicing process Boost sales with labels & badges Add social proofs & create FOMO
Or get valuable updates and private deals regarding Shopify here.