View Single Post
  #1  
Old 11-29-2002, 05:55 AM
 
ciava ciava is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: UK
Posts: 56
 

Default HELP! ADD TO CART BUTTON ON PRODUCTS.TPL

Hi

I by no means a programmer, ive been trying to add the add to cart button on the products.tpl, but keep on coming up with error.

I have tried implementing the following smarty.php code, but still gets error on page.

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="144">
<form name=orderform_{$product.productid} method=post action="cart.php?mode=add">
<tr bgcolor="666666">
<td height="1" colspan="5"></td>
</tr>
<tr bgcolor="cccccc">
<td height="14" colspan="5">{$products[product].product|escape}</font></td>
</tr>
<tr bgcolor="666666">
<td height="1" colspan="5"></td>
</tr>
<tr>
<td height="14" colspan="5"></td>
<tr>
<td width="86" height="12"><font class="product_fields_tittle">Efind no:</font></td>
<td width="277" height="12" align="left" class=product_fields_input>{$products[product].productcode}</td>
<td width="440" height="12"></td>
<td width="111" height="12" align="left"><font class="product_fields_tittle">Availability:</font></td>
<td width="217" height="12" align="left" class=product_fields_input>{$products[product].avail}</td>
</tr>
<tr>
<td width="86" height="12"><font class="product_fields_tittle">Manufacturer:</font></td>
<td width="277" height="12" class=product_fields_input align="left">{$products[product].param00}</td>
<td width="440" height="12"></td>
<td width="111" height="12" align="left"><font class="product_fields_tittle">Price ex VAT:</font></td>
<td width="217" height="12" align="left"><font class=TableCenterProductTitleRed>{include
file="currency.tpl" value=$products[product].price}</font></td>
</tr>
<tr>
<td width="86" height="15"><font class="product_fields_tittle">Mfr Sku no:</font></td>
<td width="277" height="15" align="left" class=product_fields_input>{$products[product].param02}</td>
<td width="440" height="15"></td>
<td width="111" height="15" align="left"><font class="product_fields_tittle">Price Inc VAT:</font></td>
<td width="217" height="15" align="left" class=TableCenterProductTitleBlk>{$products[product].param01}</td>
</tr>
<tr valign="middle" align="center">
<td height="1"> </td>
<td height="1"></td>
<td height="1"></td>
<td height="1" colspan="2"> </td>
</tr>
<tr valign="middle" align="center">
<td height="1" colspan="5">
<table width="70%" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td bgcolor="ff6600" ></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="24"> </td>
<td height="24"></td>
<td height="24"></td>
<td height="24" colspan="2" valign="bottom"><a href="javascript:if (FormValidation()) document.orderform.submit()">{include
file="buttons/add_to_cart.tpl"}</a> </td>
</tr>
<tr align="right">
<td height="20" colspan="5">


</p>
</td>
</tr>
<tr>
<td height="9" colspan="5">
<input type=hidden name=mode value=add>
<div align="left">{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else} {if $products[product].price ne 0} {if $products[product].discount
ne 0} <font class=MarketPrice>{$lng.lbl_market_price}: <s>{math equation="(price/(100-discount))*100"
price=$products[product].price discount=$products[product].discount
format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted}</s></font>

{/if} <font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl"
alter_currency_value=$products[product].price}</font>{if $products[product].discount
ne 0}, save {$products[product].discount}%{/if} {else} <font class=TableCenterProductTitleOrange>{$lng.lbl_ente r_your_price}</font>
{/if} {/if} </div>
</td>
</tr>
<tr bgcolor="cccccc">
<td height="1" colspan="5"></td>
</tr>
<tr>
<td height="10" colspan="5"></td>
</tr>

</form>
</table>
{/section}


Any help would be grateful.

Many thanks
anton
Reply With Quote