panupat Posted September 7, 2013 Share Posted September 7, 2013 (edited) Hi. I'm trying to figure out a way to insert image into my product pages. I'm wondering if what I'm thinking is possible? - Create images using product name as file name. So if the product is ABC123, the image would be ABC123.jpg - Next, how do I combine text with variable? What I need is probably like this $theURL = http://site/dir/dir/ ... + ... {$product->name|escape:'htmlall':'UTF-8'} .. + .jpg Then I'll use that with file_exists {if file_exists($theURL) [spam-filter] <img src="{$theURL}"> {/if} Possible to do this all in the .tpl file? Any help appreciate, thanks! Edited September 7, 2013 by panupat (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 7, 2013 Share Posted September 7, 2013 example of the code: {assign var=my value='this is '} {assign var=variable value='lazy saturday'} {assign var=myVariable value="{$my}{$variable}"} {$myVariable} {$myVariable} will display "this is lazy saturday" Link to comment Share on other sites More sharing options...
amerigeau Posted February 5, 2015 Share Posted February 5, 2015 Hi, The post is old but I think this post could help you too : http://arnaud-merigeau.fr/integration-prestashop-combiner-des-variables-smarty/ Have a nice day 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