THE SUBTOTAL TEMPLATE

Templates are pre-built HTML pages built beforehand in which the data returned from the server will be placed. You build a template as you would any other HTML page, with the usual formatting tags. Template tags tell the server the location(s) within the web page that data should be returned to. The placement of the returned data depends on where you place your template tags within the page.

A subtotal page is a template that returns the values of what the customer has ordered and placed in the shopping cart, including the placement of the table that contains the item id, quantity, description, price, shipping and the subtotal of all items.

Example Subtotal Template

<html>
<head>
<title>Example Subtotal Page</title>
</head>

<body>

##TP_BeginForm##
(This is beginning of the form and replaces the <FORM> tag.)

<table width="100%" border="0" bgcolor="#000000" cellpadding="2" cellspacing="1">
<tr>
<td width="15%" align="center"><color="#FFFFFF">ID#</font></td>
<td width="15%" align="center"><color="#FFFFFF">DELETE</td>
<td width="10%" align="center"><color="#FFFFFF">QUANTITY</td>
<td width="30%" align="center"><color="#FFFFFF">DESCRIPTION</td>
<td width="15%" align="center"><color="#FFFFFF">PRICE</td>
<td width="15%" align="center"><color="#FFFFFF">TOTAL</td>
</tr>
</table>
(The above code shows you only one method that you could use to format the static part of your web page. You can code it any way you want, you are not confined to this example.)

##TP_CUSTOM_TABLE##
This is where you drop in your custom table. You can either use the above tag, and then create a text file and call it subtotal.htm_tbl, or you can replace the above line of code with the following:

<input type="hidden" name="Subtotal Table" value="/path/filename.htm">
Please see the Custom Tables for more details.

<input type="hidden" name="EST_TAX" value="yes">
This tag is mandatory if you are using the Estimated Tax Method.

<input type="hidden" name="MULTI_ZIP_EST_TAX" value="\path\filename.mdb">
This tag is mandatory if you are shipping products from different zip source locations.

<input type="hidden" name="EST_SHIP_SOURCE_ZIP" value="YourZipCode">
You need to put the zip code of where the item will be shipped from so that the proper tax and shipping calculations can be made.

<input type="hidden" name="EST_TAX_ZIP_ERRORPAGE" value="/nozip.htm" target="_blank">
This is the page that will display if your customer doesn't enter their zip code into the form. Create an HTML file called 'nozip.htm' and tell your customer that they forgot to fill in their zip code.

##ApplyToShipping##
Use this tag if you want to charge tax on the shipping charges.

<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td><a href="/cgi-bin/clearcart.exe?nextpage=/subtotal.htm">CLEAR CART</a></td>
<td align="right">SUBTOTAL</td>
</tr>
<tr>
<td colspan="2" align="right">$ ##TP_CUSTOM_SUBTOTAL##</td>
</tr>
<tr>
<td colspan="2" align="center">##DISCOUNTMODULE##</td>
</tr>
</table>
Once again, the above is example HTML and you are not confined to this format.

  • CLEAR CART - gives your customer the option of clearing their cart once they've reached the subtotal page.
  • ##TP_CUSTOM_SUBTOTAL## - drops the cart's subtotal into the web page.
  • ##DISCOUNTMODULE## - If you offer discounts or coupons, this is where your customer enters in either the discount code or the coupon percentage. Please see Discounts & Coupons for further details.

<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr> 
<td width="50%" align="right">Destination Zip Code:</td>
<td><input type="text" name="EST_SHIP_DEST_ZIP" value="" size="6"></td>
</tr>
The above code creates a text box for your customer to type their zip code into. Notice that the value is left blank.

<tr>
<td align="right">Shipping Method:</td>
<td>
<SELECT NAME="EST_SHIP_TABLE">
<OPTION value="None">Please see Shipping Options for list</OPTION>
</SELECT>
</td>
</tr>
The above code creates a drop-down list of shipping options your customer can choose from.

<tr>
<td align="right">Destination Country:</td>
<td>
<SELECT NAME="Est_Country">
<OPTION>Please see List of Countries</OPTION>
</SELECT>
</td>
</tr>
The above code creates a drop-down list of countries your customer can choose from.

<tr>
<td align="right" valign="top">Payment Type:</td>
<td>
<input type="radio" name="template" value="\cc_total.htm">Credit Card
<input type="radio" name="template" value="\check_total.htm" checked>EFT/ACH
<input type="radio" name="template" value="\purchase_order.htm">Purchase Order
</td>
</tr>
</table>
The above code creates a set of radio buttons your customer can use to select their preferred payment method. You will need to create a separate HTML file for each option with the appropriate variables for each method on the corresponding pages.

<input type="hidden" name="totaltable" value="\path\filename.htm">
The path and filename to the custom total template. You can also use the following:

<input type="hidden" name="template" value="\path\filename.htm">

##TP_Endform##
The end of the form. This replaces the </FORM> tag.