sandokan71 Posted January 10, 2012 Share Posted January 10, 2012 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 More sharing options...
CartExpert.net Posted January 10, 2012 Share Posted January 10, 2012 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 More sharing options...
sandokan71 Posted January 11, 2012 Author Share Posted January 11, 2012 Hi, Great. Thank you. It works...had to struggle with css selectors though. This should be a default option in prestashop... 1 Link to comment Share on other sites More sharing options...
digitohter Posted January 31, 2012 Share Posted January 31, 2012 I don't understand, what am I exactly must to do with product.tpl? Must I add this row somewhere or modify some row? With product_list.tpl everything is fine and it's working. Link to comment Share on other sites More sharing options...
wippa Posted January 4, 2013 Share Posted January 4, 2013 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 More sharing options...
Martijnsb Posted February 23, 2013 Share Posted February 23, 2013 I can't get it working on the product.tpl page. On the product_list.php it works. Does somebody has a solution or more detailed description from the solution above? Thank you! Link to comment Share on other sites More sharing options...
wippa Posted May 4, 2013 Share Posted May 4, 2013 (edited) 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 May 4, 2013 by wippa (see edit history) Link to comment Share on other sites More sharing options...
abc123456 Posted December 2, 2013 Share Posted December 2, 2013 i follow as intructed but my new price still do not reflect changes in colour. I am using prestashop 1.3.1 Link to comment Share on other sites More sharing options...
vekia Posted December 2, 2013 Share Posted December 2, 2013 guide above is for ps 1.5 share url to your website. Link to comment Share on other sites More sharing options...
abc123456 Posted December 3, 2013 Share Posted December 3, 2013 http://su-estilo.com/35-sale Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 you use non default theme with own different than default styles. yu have to create code which will work with your non-default theme. Link to comment Share on other sites More sharing options...
Vascocst Posted September 28, 2016 Share Posted September 28, 2016 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 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 More sharing options...
asperon Posted October 22, 2017 Share Posted October 22, 2017 I need little help with structure of code for 1.6 if is possible thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now