Change the colour of compare price on collection and product page.

Solved

Change the colour of compare price on collection and product page.

Eze_Paul
Excursionist
42 0 8

Hi guys. Am using Expanse theme, I wish to change compare price colour to black on both collection and product page. Please me with code.

 

Thanks!

 

www.hyggehusmobler.se

 

 

Screenshot 2024-02-25 at 13.18.26.png

Accepted Solution (1)

PageFly-Henry
Shopify Partner
1184 335 297

This is an accepted solution.

Hi @Eze_Paul 

This is Henry from PageFly - Landing Page Builder App

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file components.css

Step 3: Paste the below code at bottom of the file -> Save


span.product__price.product__price--compare span, span.grid-product__price--original span {color: black !important;}

 

Hope that my solution works for you.

Best regards,

Henry | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 2 (2)

dennismathenge
Shopify Partner
27 1 3

Hello Eze_Paul,

 

Looking at your shop, all the div elements for the prices have the color red, that's why your they all look similar.

In the product page with the discount prices, you have the following structure:

<span data-compare-price="" class="product__price product__price--compare">
<span aria-hidden="true">16 000 kr</span>
<span class="visually-hidden">16 000 kr</span>
</span>

Adding the following somewhere in your theme should fix it:
.product__price--compare {
   color: #000;
}

In the collection page, you have the following structure for prices with a discount:

<div class="grid-product__price"><span class="visually-hidden">Sale price</span><span class="grid-product__price--current">
<span aria-hidden="true">17 900 kr</span>
<span class="visually-hidden">17 900 kr</span>
</span><span class="visually-hidden">Regular price</span>
                  <span class="grid-product__price--original">
<span aria-hidden="true">20 000 kr</span>
<span class="visually-hidden">20 000 kr</span>
</span><span class="grid-product__price--savings">
                      Save 11%
                    </span></div>

Adding the following somewhere in your theme should fix it:
.grid-product__price--current {
   color: #000;
}

PageFly-Henry
Shopify Partner
1184 335 297

This is an accepted solution.

Hi @Eze_Paul 

This is Henry from PageFly - Landing Page Builder App

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file components.css

Step 3: Paste the below code at bottom of the file -> Save


span.product__price.product__price--compare span, span.grid-product__price--original span {color: black !important;}

 

Hope that my solution works for you.

Best regards,

Henry | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.