Jump to content

Display "Used" ribbon over the product image when item have set from backoffice condition used


Recommended Posts

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 :)

Link to comment
Share on other sites

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

 
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 16

Warning: 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 by stoicescu.mihai (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...