boyjarv Posted April 10, 2012 Share Posted April 10, 2012 hi, I have defined 2 new product image sizes in my prestashop bottle = 60x135 clothing = 100x135 in my product-list.tlp page I have the following line for: bottles <a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'bottle')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($bottleSize)} width="{$bottleSize.width}" height="{$bottleSize.height}"{/if} /></a> I need to wrap a conditional statement around this for Clothing and say something like.... IF $product.id_image, 'clothing' THEN give it teh clothing height and width Thanks Link to comment Share on other sites More sharing options...
tomerg3 Posted April 10, 2012 Share Posted April 10, 2012 id_image will always be a number. I assume you mean the name of the image (Legend), in which case it would be: {if $product.legend == 'clothing'} clothing... {else} normal.... {/if} Link to comment Share on other sites More sharing options...
boyjarv Posted April 11, 2012 Author Share Posted April 11, 2012 thanks, but how would I be able to determine weather the $product.legend is 'bottle' or 'clothing'? Link to comment Share on other sites More sharing options...
tomerg3 Posted April 11, 2012 Share Posted April 11, 2012 When you add an image to a product, you give it a name (caption) http://screencast.com/t/Dh4BMIbm That is the value of $product.legend 1 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