tommyinnn Posted October 24, 2010 Share Posted October 24, 2010 (edited) Is there any way to add images on the Ajax order form? I tried adding the below example code to the order/templates/products.tpl file with no luck <span style="position:absolute;left:711px;top:70px;z-index:13;"> {php} <?php if ($gid=="4") { print ("<IMG SRC =images/image_a.png>"); } if ($gid=="5") {print ("<IMG SRC =images/image_b.png>");} else {} ?> {php} </span> Edited October 24, 2010 by tommyinnn 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted October 25, 2010 Share Posted October 25, 2010 You're missing quotes - <IMG SRC ="images/image_a.png"> Try: <span style="position:absolute;left:711px;top:70px;z-index:13;"> {php} <?php if ($gid=="4") { print ('<IMG SRC ="images/image_a.png">'); } if ($gid=="5") {print ('<IMG SRC ="images/image_b.png">');} else {} ?> {php} </span> 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted October 25, 2010 Share Posted October 25, 2010 Is there any way to add images on the Ajax order form?I tried adding the below example code to the order/templates/products.tpl file with no luck <span style="position:absolute;left:711px;top:70px;z-index:13;"> {php} <?php if ($gid=="4") { print ("<IMG SRC =images/image_a.png>"); } if ($gid=="5") {print ("<IMG SRC =images/image_b.png>");} else {} ?> {php} </span> Where do you want the image to be. Before the products or before the product groups? 0 Quote Link to comment Share on other sites More sharing options...
tommyinnn Posted October 26, 2010 Author Share Posted October 26, 2010 Thanks for the response, I wanted to add the logo of the product - for example, on this page, http://clients.shoutcastautodj.com/order/?gid=2&skip=1 which sells cPanel web hosting, I would add the cPanel logo My coding is still not working, have tried with/without " With $product.pid - With $gid - this would really make the Ajax order page look great, could even add more product details like in the older order form 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted October 26, 2010 Share Posted October 26, 2010 (edited) Thanks for the response, I wanted to add the logo of the product - for example, on this page, http://clients.shoutcastautodj.com/order/?gid=2&skip=1 which sells cPanel web hosting, I would add the cPanel logo My coding is still not working, have tried with/without " With $product.pid - With $gid - this would really make the Ajax order page look great, could even add more product details like in the older order form If you want to add an image in the product group selection Locate the following in /order/templates/master.tpl: {foreach from=$groups item=group}<input type="radio" name="gid" value="{$group.gid}" id="gid{$group.gid}" onclick="loadproducts('{$group.gid}')" /> <label for="gid{$group.gid}">{$group.name}</label> {/foreach} Replace with: {foreach from=$groups item=group}<input type="radio" name="gid" value="{$group.gid}" id="gid{$group.gid}" onclick="loadproducts('{$group.gid}')" /> {if $group.gid eq 1}<img src="/your/image/here/groupid1.jpg">{elseif $group.gid eq 2}<img src="/your/image/here/groupid2.jpg">{else}<label for="gid{$group.gid}">{$group.name}</label>{/if} {/foreach} If you want to add an image in the product selection Locate the following in /order/templates/product.tpl: {foreach from=$products item=product key=num} <td width="50%"><input type="radio" name="pid" value="{$product.pid}" id="pid{$product.pid}" onclick="loadproductconfig('{$product.pid}')"> <label for="pid{$product.pid}">{$product.name}</label></td> {if $num % 2}</tr><tr>{/if} {/foreach} Replace with: {foreach from=$products item=product key=num} <td width="50%"><input type="radio" name="pid" value="{$product.pid}" id="pid{$product.pid}" onclick="loadproductconfig('{$product.pid}')"> {if $product.pid eq 1}<img src="/your/image/here/productid1.jpg">{elseif $product.pid eq 2}<img src="/your/image/here/productid2.jpg">{else}<label for="pid{$product.pid}">{$product.name}</label>{/if}</td> {if $num % 2}</tr><tr>{/if} {/foreach} Edited October 26, 2010 by m00 0 Quote Link to comment Share on other sites More sharing options...
tommyinnn Posted October 26, 2010 Author Share Posted October 26, 2010 WOW, Thanks! 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.