Jump to content

[SOLVED] How to add an image (alert) with some reference code


urota010

Recommended Posts

Hi,

please for help

PS 1.5.6.0.

 

how to product.tpl write code to add an image to the specified reference code

I have more reference (multiple suppliers), such as MBO-XXXXX, MDL-XXXX and I want to take only the first three letters of the condition

eg. in product.tpl

---------------

{if product_reference = "MBO"}

<src="/img/product_ship_over_28.png" <img width="133" height="50" alt="purchase over $28">

 

{elseif product_reference = "MDL"}

<src="/img/alert.png" <img width="133" height="50" alt="purchase over $28">

.....

.....

{/ if}

----------------------

but that's not working ..

 

Thanks for any help

Link to comment
Share on other sites

Hi

 

You were close.

Try this :

 

{if substr($product->reference,0,3) == 'MBO'}
 
<src="/img/product_ship_over_28.png" <img width="133" height="50" alt="purchase over $28">
 
{elseif substr($product->reference,0,3) == "MDL"}
<src="/img/alert.png" <img width="133" height="50" alt="purchase over $28">
.....
.....
{/ if}

 

Regards

  • Like 1
Link to comment
Share on other sites

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...