stoicescu.mihai Posted December 12, 2014 Share Posted December 12, 2014 Hy all, How the title say, It is possible to display "Used" ribbon over the product image when item have set from backoffice condition "used". Thx, Link to comment Share on other sites More sharing options...
NemoPS Posted December 12, 2014 Share Posted December 12, 2014 First, locate the following inside product.tpl {if $product->new} <span class="new-box"> <span class="new-label">{l s='New'}</span> </span> {/if} Right after that, add {if $product->condition && $product->condition == 'used} <span class="new-box"> <span class="new-label">{l s='Used'}</span> </span> {/if} This will, however, put it in the same spot as the new block. If you want it at the bottom, change new-box and new-label to something else, then add css accordingly. Likely position: absolute; bottom: 0;right:0And adjust from there Link to comment Share on other sites More sharing options...
stoicescu.mihai Posted December 12, 2014 Author Share Posted December 12, 2014 First, locate the following inside product.tpl {if $product->new} <span class="new-box"> <span class="new-label">{l s='New'}</span> </span> {/if} Right after that, add {if $product->condition && $product->condition == 'used} <span class="new-box"> <span class="new-label">{l s='Used'}</span> </span> {/if} This will, however, put it in the same spot as the new block. If you want it at the bottom, change new-box and new-label to something else, then add css accordingly. Likely position: absolute; bottom: 0;right:0 And adjust from there Thx man, With your help it works now. I create and rename a new box and new label (ex : .used-box and .used-label) , edit global.css and now it work fine. One question i have : how i do, to see effect on homepage . I think that something must change in product list. Best regards! Link to comment Share on other sites More sharing options...
NemoPS Posted December 13, 2014 Share Posted December 13, 2014 Ah, I thought you meant the single product page. You must use a similar method for product.list-tpl (just remember product is an array, not an object) Link to comment Share on other sites More sharing options...
stoicescu.mihai Posted December 14, 2014 Author Share Posted December 14, 2014 (edited) I fail to solve, and now gives me the error in homepage below : Strict Standards: Declaration of Dispatcher::loadRoutes() should be compatible with DispatcherCore::loadRoutes($id_shop = NULL) in override/classes/Dispatcher.php on line 16Warning: Cannot modify header information - headers already sent by (output started at /public_html/override/classes/Dispatcher.php:16) in classes/controller/FrontController.php on line 790 and I have not changed anything. Help me please! Edited December 14, 2014 by stoicescu.mihai (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted December 15, 2014 Share Posted December 15, 2014 Impossible You added an override for the dispatcher class, which is not compatible with your ps version Link to comment Share on other sites More sharing options...
stoicescu.mihai Posted December 15, 2014 Author Share Posted December 15, 2014 To me everything is possible . I must to watch tonight when I get home to see what I did there, and come back with information. Link to comment Share on other sites More sharing options...
stoicescu.mihai Posted December 15, 2014 Author Share Posted December 15, 2014 I fail to make see ribbon in the product list.What is wrong in what I write below (with red). {if isset($product.new) && $product.new == 1} <span class="new-box"> <span class="new-label">{l s='New'}</span> </span> {/if} {if isset($product->condition == 'used') && $product->condition == 'used'} <span class="used-box"> <span class="used-label">{l s='used'}</span> </span> {/if} {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} <span class="sale-box"> <span class="sale-label">{l s='Sale!'}</span> </span> {/if Link to comment Share on other sites More sharing options...
NemoPS Posted December 16, 2014 Share Posted December 16, 2014 As I said above, it's not an object, it's an array, so you need to use $product.condition Link to comment Share on other sites More sharing options...
Recommended Posts