Adding Items To Your HTML Page

TechCart uses hidden form fields in your HTML file to realize the product information in your store. We have provided a tool to generate these forms for you. (
Form Code Generator). This tool will ask you several questions and then generate the html to add into your HTML.  We recommend using this but in case you want to know the workings of the code it is explained further here.  It is assumed that you have a general knowledge of HTML and forms.

The following code adds a would add the correct form fields to a page for a College Dictionary costing 14.95 with a product id code of 123-45.

(you would replace the urls to match your installation needs)

<form method="POST" action="http://www.tech-host.com/cgi-bin/bin1/cart.cgi">
<input type="hidden" name="com" value="add">
<input type="hidden" name="un" value="demo">
<input type="hidden" name="pid" value="123-45">
<input type="hidden" name="price" value="14.95">
<input type="hidden" name="desc" value="College

Dictionary">
<input type="hidden" name="back" value="http://www.techcommerce.com/docs/pagecode.html">
<input type="text" name="qty" size="4">
<input type="submit" value="Add To Cart">

 

The web page of this code would look like this:

You would obviously add in additional HTML to display the product information to the web page visitor.

A breakdown of the code is as follows:

<form method="POST" action="http://www.tech-host.com/cgi-bin/bin1/cart.cgi">

This is the location of the shopping cart software.  

<input type="hidden" name="com" value="add">

This instructs the software to "add" the item to the cart.  com stands for command.  You may change the value of "com" to "AddSecret" to add the item to the cart without the confirmation screen.

<input type="hidden" name="un" value="demo">

This line lets the TechCart software know what username is accessing the software.  In the example we use the user name demo.  You would change the value="demo" to value="username".

<input type="hidden" name="pid"
value="123-45">


This tells the TechCart software the product number or SKU# of the item being added to the cart.  This field is recommended however it is optional. In this example the product ID is "123-45".  

<input type="hidden" name="price" value="14.95">

This tells the TechCart software the price of the item being added to the cart. This field is required.  In this example the price of the item is $14.95.  Do not use a dollar sign ($) in this field. if you do your totals will not be calculated correctly.

<input type="hidden" name="desc" value="College
Dictionary
">


This field tells the TechCart software the one line description of the item being added to the cart.  This should be brief and to the point.  This will be what appears on the invoice. In the example the item description is "College Dictionary"

<input type="hidden" name="back" value="http://www.techcommerce.com/docs
/pagecode.html
">


This tells the TechCart software where it should go if a user selects "continue shopping" from the "Item Added To Cart" confirmation screen.  This is also used to tell the TechCart software what page to load if you have specified "AddSecret" in the "com" field to turn off confirmations.

<input type="text" name="qty" size="4">

This field displays the Quantity box.  The "type" field can be changed from "text" to "hidden" and a value= field can be added if you wanted to default the quantity to 1 or some other number.

<input type="submit" value="Add To Cart">

This displays the add to cart button.


Back To Contents