urota010 Posted October 27, 2013 Share Posted October 27, 2013 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 More sharing options...
math_php Posted October 28, 2013 Share Posted October 28, 2013 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 1 Link to comment Share on other sites More sharing options...
urota010 Posted October 28, 2013 Author Share Posted October 28, 2013 Hi, @math_php many thanks to your help, this works great Regards Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2013 Share Posted October 28, 2013 hello thank you for postin solution math im going to mark this topic as [solved] with regards, Milos 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