Jump to content

Ajax order form - add images


tommyinnn

Recommended Posts

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 by tommyinnn
Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by m00
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated