simplybe Posted April 22, 2009 Share Posted April 22, 2009 Hi, Is it possible to show a certain image for each product based on the $gid Something like this ? {if $productgroup.gid eq "6" show image 1 {if $productgroup.gid eq "7" show image 2 I want the image to change in the template for each $gid Thanks for any help 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted April 22, 2009 Share Posted April 22, 2009 Yes, it'd be more along the lines of: {if $productgroup.gid eq "6"} <img src="image1.jpg"> {elseif $productgroup.gid eq "7"} <img src="image2.jpg"> {/if} etc... 0 Quote Link to comment Share on other sites More sharing options...
simplybe Posted April 22, 2009 Author Share Posted April 22, 2009 (edited) Thanks will give it a try today Edit Didn't work using the following code: <td> {if $productgroup.gid eq "6"} <img src="images/linux.gif" alt="linux" width="55" height="67" /> {elseif $productgroup.gid eq "17"} <img src="images/ssl.gif" alt="ssl" width="55" height="67" /> {/if} </td> No matter what gid i am on the ssl.gif is called ? cart.php?gid=6 shows the ssl.gif cart.php?gid=17 also shows the ssl.gif Thanks Edited April 22, 2009 by simplybe 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted April 22, 2009 Share Posted April 22, 2009 <td> {if ($productgroup.gid == '6')} <img src="images/linux.gif" alt="linux" width="55" height="67" /> {elseif ($productgroup.gid == '17')} <img src="images/ssl.gif" alt="ssl" width="55" height="67" /> {/if} </td> 0 Quote Link to comment Share on other sites More sharing options...
simplybe Posted April 22, 2009 Author Share Posted April 22, 2009 Hi, Same thing, only shows the ssl gif ? 0 Quote Link to comment Share on other sites More sharing options...
simplybe Posted April 22, 2009 Author Share Posted April 22, 2009 Got it working: <td> {if ($gid == '6')} <img src="images/linux.gif" alt="linux" width="55" height="67" /> {elseif ($gid == '17')} <img src="images/ssl.gif" alt="ssl" width="55" height="67" /> {/if} </td> Thanks to both of you for your help 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted April 23, 2009 Share Posted April 23, 2009 or make it easy on yourself ... <img src="images/product{$gid}.gif" ... 0 Quote Link to comment Share on other sites More sharing options...
simplybe Posted April 23, 2009 Author Share Posted April 23, 2009 or make it easy on yourself ... <img src="images/product{$gid}.gif" ... Excellent idea:) I only need the 2 images so i am ok but if you offer more than 2 product groups then your way would sure save some time. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.