australopitecu Posted October 29, 2014 Share Posted October 29, 2014 Hi, I need to change the background color of only one button of categories that are on the left side of the screen. I've been trying for days but the only thing I get is change the color of all the categories. Thank you. Link to comment Share on other sites More sharing options...
australopitecu Posted October 29, 2014 Author Share Posted October 29, 2014 My Prestashop Version: 1.5.4.1. Thanks Link to comment Share on other sites More sharing options...
S-HAMMANI Posted October 29, 2014 Share Posted October 29, 2014 (edited) Hi You can insert a class provided the value of category id, as: <tag class=" {if $category->id == 4}new-class-name{/if}"> ... in css file add .new-class-name{ background-color: new-color-value !important; } Edited October 29, 2014 by S-HAMMANI (see edit history) Link to comment Share on other sites More sharing options...
australopitecu Posted October 30, 2014 Author Share Posted October 30, 2014 Hi S-Hammani, Thanks for your response. Sorry but I'm not informatic ... can you tell me more specific information? For example: my category's ID is # 3. It Would be... <tag class = "{if $ Category-> id == 3} new-class-name {/ if}"> But, where have I to put it?? The color is # F00: It would be? .new-class-name { background-color: # F00! important; } But where in the global.css I have to put it ?? Thank you man! Link to comment Share on other sites More sharing options...
musicmaster Posted October 30, 2014 Share Posted October 30, 2014 You should put it into your template: product.tpl or product-list.tpl in the text that defines the button. For the functionality it doesn't matter where you put it in the global css file. You choose to put it near related lines - that is easy for debugging if there are problems - or you can choose to keep it near the top in order to have an overview of your modifications. Link to comment Share on other sites More sharing options...
australopitecu Posted October 30, 2014 Author Share Posted October 30, 2014 Thanks for your effort ... but it doesnt work. I dont know why this simple thing is difficult to do. I hope someone can do it. Best regards, Alejandro Link to comment Share on other sites More sharing options...
colorlife Posted October 12, 2016 Share Posted October 12, 2016 Hello...have you resolve? I need do for each category Link to comment Share on other sites More sharing options...
Recommended Posts