Operating Manual
Shopping Cart
Cart Interface
|
Shopping Cart Interface
Shopping Cart interface provided by cart.pl script. The script is a CGI (Common Gateway
Interface) program, which can accept commands from forms placed on your html pages.
The generic form is as follows:
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="viewcart">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="View Cart">
</form>
The form above assumes that cart.pl script resides in the current directory.
Normally you should not place your html files into Accounts Online executables directory,
thus the value for action should contain url of cart.pl.
The cmd hidden input specify command to execute (described later). The form code
produces standard gray button. You can replace it with your own image or use cart.pl ssi
interface to generate graphics buttons and icons provided by Shopping Cart module.
If template input presents, its value overrides default template filename set within System Setup panel
Shopping Cart module accepts the following commands:
1. Add to Cart
Adds an item to cart.
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="add">
<input type="hidden" name="prodid" value="your-product-id-here">
<input type="hidden" name="quantity" value="quantity-here">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="Add to cart">
</form>
The form being submitted adds to cart product with id specified by prodid field
in a quantity specified by optional quantity field. By default quantity is 1.
Shopping Cart module will automatically retrieve product description and price from
Accounts Online database. If Fast add check box (System Setup panel) is selected,
browser will be redirected back to the page, from which add command was initiated.
2. View Cart
Display contents of a cart.
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="viewcart">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="View Cart">
</form>
3. Checkout
Displays checkout form.
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="checkout">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="Checkout">
</form>
4. Reset
Removes all items from customer's shopping cart.
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="reset">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="Checkout">
</form>
5. Buy
Produces credit card payment form.
<form method="POST" action="cart.pl">
<input type="hidden" name="cmd" value="cartbuy">
<input type="hidden" name="template" value="your-templatename-here">
<input type="submit" value="Proceed to payment form">
</form>
|