Add text to specific items on cart page e.g. 'sale' for items with discount?

Add text to specific items on cart page e.g. 'sale' for items with discount?

peaches22
Excursionist
38 3 9

Hi there, I would like to have the word 'Sale'/'Discount' next to the price of discounted items only in the shopping cart page. Please see attached images. Can this be done?  Can anyone tell me how to do this, please?

Currently:

cart-before.jpg

What I'm trying to get:

cart-after.jpg

 

Replies 7 (7)

Made4uo-Ribe
Shopify Partner
10211 2427 3078

Hi @peaches22 ,

Would you mind to share your URL website? with password if its protected. 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.
peaches22
Excursionist
38 3 9

Hi @Made4uo-Ribe ,

URL: https://www.rubysambition.com.au/

Password: potatododo

Thanks!

Made4uo-Ribe
Shopify Partner
10211 2427 3078

Thank you for the information. 

Try this one. 

  1. From your Shopify admin dashboard, click on "Online Store" and then "Themes".
  2. Find the theme that you want to edit and click on "Actions" and then "Edit code".
  3. In the "Assets" folder, click on "base.css" file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
  4. And Save.
.product-option:nth-child(2):after {
    content: "Sale!";
    color: red;
    font-style: italic;
}

 Result:

Ribe_Dagandara_0-1688307141479.png

It is like this? I hope it help.

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.
peaches22
Excursionist
38 3 9

@Made4uo-Ribe , it looks great but the problem is, the word 'Sale!' appears with every product. Is there a way to make it appear with only specific products e.g. those with discount? I use 'compare price at' method for discounting items.

Made4uo-Ribe
Shopify Partner
10211 2427 3078

Yeah, i just thought that is what you mean. Because the other solution that I think is you need to write a liquid code for this design. 

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.
peaches22
Excursionist
38 3 9

Hi @Made4uo-Ribe , it's okay now, I'm just using an app to do that, cheers 🙂

MCTP
New Member
5 0 0

Out of interest, which app did you end up using?