Jump to content

-SOLVED- Reduced price color


sandokan71

Recommended Posts

Hi to everybody,

 

I'm tryin to find out something that should be quite obvious :

 

If i have some kind of price reduction, I would like to change the color of the reduced price only, leaving all normal prices as it is. It looks like I can only change the color of the old price showing next to the new reduced price....

 

Does anybody have an idea how to handle this ?

 

Thanks a lot...

Link to comment
Share on other sites

Hello!

Replace

<span class="price"

with

<span class="price{if isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} reduced_price{/if}"

in product_list.tpl

 

In product.tpl you can use this if statement:

{if $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} reduced_price{/i}

 

Then set the css style for the 'reduced_price' class.

Link to comment
Share on other sites

  • 3 weeks later...
  • 11 months later...

sandokan71 > Maybe yes. At least tpl code to simply replace css instruction.

PS haves a LOT LOT LOT of css code (a looooot of). In this time, no css, no difference of class... you must create it.

 

Thanks to CartExpert for the Smarty code clear explanation.

 

I was seeking for "reduced_price" css class into css and no way, you need code it.

Thanks again :)

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Comment #2 is so clear. You need edit two tpl files and one css file.

Read carefully. Basically, I copy text from comment 2# :) but more explained.

 

Localize the product_list.tpl file into your selected theme folder. This affect to list of products.

Search and replace this

 

<span class="price"

 

with

 

<span class="price{if isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} reduced_price{/if}"

 

Because you'll need show it into product view, you must edit also product.tpl

You must copy this:

 

{if $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} reduced_price{/i}

 

 

wherever you want to display the reduced price. (i.e. to the right from original price). Paste it, see it, then modifiy later again with your needs.

 

Maybe you want to see that price underscored, red, blue, bigger or something else. You need to edit your css.

Search into your theme folder again, into css subfolder (/mytheme/css/global.css) global.css file.

 

Add into new lines a css code for reduced_price class. i.e:

 

#products_list .reduced_price, #products .reduced_price {
color: red;
text-decoration: line-throught
}

 

Regards. I cant explain to you better. Im Spanglish guy ;)

Edited by wippa (see edit history)
Link to comment
Share on other sites

  • 6 months later...
  • 2 years later...

Comment #2 is so clear. You need edit two tpl files and one css file.

Read carefully. Basically, I copy text from comment 2# smile.png but more explained.

 

Localize the product_list.tpl file into your selected theme folder. This affect to list of products.

Search and replace this

 

<span class="price"

with

 

<span class="price{if isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} reduced_price{/if}"

Because you'll need show it into product view, you must edit also product.tpl

You must copy this:

 

{if $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} reduced_price{/i}

wherever you want to display the reduced price. (i.e. to the right from original price). Paste it, see it, then modifiy later again with your needs.

 

Maybe you want to see that price underscored, red, blue, bigger or something else. You need to edit your css.

Search into your theme folder again, into css subfolder (/mytheme/css/global.css) global.css file.

 

Add into new lines a css code for reduced_price class. i.e:

 

#products_list .reduced_price, #products .reduced_price {
color: red;
text-decoration: line-throught
}
Regards. I cant explain to you better. Im Spanglish guy wink.png

 

 

 

Hello my friend(s),

 

Is this type of change possible in prestashop 1.6.1.1?

How can I change the color of the percentage?

 

Thanks :) 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...