<? include_once($_SERVER['DOCUMENT_ROOT'] . "/includes/lang.php"); ?>
<html>
<head>
<TITLE> Multi-item Submission Sample Shopping Cart | Americart Shopping Cart</title>
<META name="keywords" content="americart, best shopping cart, cartserver, cheap shopping cart,
easy shopping cart, ecommerce, e-commerce, html shopping cart, inexpensive shopping cart, online shopping cart,
online store, pay pal shopping cart, secure ecommerce, secure shopping cart, shop cart, shopping cart,
shopping cart service, shopping cart software, shopping cart solution, web commerce">
<META name="description" content="Americart: the easiest, most cost-effective ecommerce shopping cart software. It's an online service, so no software to download. Inexpensive, easy to configure - requires no programming. Used by thousands of merchants.">
</HEAD>
</head>

<body bgcolor="#ffffff" text="#000000">
<font face=verdana size=-1><b>
<h3>Try our wonderful bread!</h3>
Check all you'd like and click on "add to cart".<p>
<form action=http://www.cartserver.com/sc/cart.cgi method=POST>
<input type=hidden name=item value="a-1357">
<input type=checkbox name=item_rye value="a-1357^rye^loaf of Rye^2.22^1">Rye Loaf<br>
<input type=checkbox name=item_wheat value="a-1357^wheat^loaf of Wheat^2.22^1">Wheat Loaf<br>
<input type=checkbox name=item_anything value="a-1357^oat^loaf of Oat^2.22^1">Oat Loaf<br>
<input type=checkbox name=item_unique value="a-1357^white^loaf of White^2.22^1">White Loaf<br>
<input type=checkbox name=item_works value="a-1357^hny^loaf of Honey^2.22^1">Honey Loaf<br>
<input align=center type=image border=0 name=add
src="add-red.gif" width=89 height=38>
</form>
<hr size=5>
Note: We made the first item below be a select box instead of
a plain text box to illustrate drop down for quantity. Both
methods can work interchangeably as you can see.<p>
<form action=http://www.cartserver.com/sc/cart.cgi method=POST>
<input type=hidden name=item value="a-1357">
<input type=hidden name=item_rye value="a-1357^rye^loaf of Rye^2.22^op1">
<select name=op1_rye>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>Rye Loaf<br>
<!--<input type=text size=2 name=op1_rye value="0">Rye Loaf<br>-->
<input type=hidden name=item_wheat value="a-1357^wheat^loaf of Wheat^2.22^op1">
<input type=text size=2 name=op1_wheat value="0">Wheat Loaf<br>
<input type=hidden name=item_anything value="a-1357^oat^loaf of Oat^2.22^op1">
<input type=text size=2 name=op1_anything value="0">Oat Loaf<br>
<input type=hidden name=item_unique value="a-1357^white^loaf of White^2.22^op1">
<input type=text size=2 name=op1_unique value="0">White Loaf<br>
<input type=hidden name=item_works value="a-1357^hny^loaf of Honey^2.22^op1">
<input type=text size=2 name=op1_works value="0">Honey Loaf<br>
<input align=center type=image border=0 name=add
src="add-red.gif" width=89 height=38>
</form>
<hr>
This page illustrates two very simple
examples of how to put more than one type of item in your
basket at the same time. Using this method, you could build
a more traditional "order form", or just have a logical grouping
of items likely to be ordered together.<p>

In the above example, we assume that a customer wants to buy
bread. In all likelyhood, they will want more than one type.
To avoid them having to do four "add to cart" functions to
buy four types of bread, we offer this method.<p>

We discourage you from building large, single page order forms
with all you products on it, although it will work just fine
from a technical point of view as far as Americart is concerned.
If a single form gets too large, it will start to "act up" on
some shopper's browsers, as available memory is exhausted. Instead,
we encourage either single item "add to cart"s or logical groupings
like the above.<p>

There are coding differences to make multi-item submissions work
correctly. We cannot, of course, have all products in a grouping be
"name=item", since they would overwrite each other. Instead, we make the
"item" variable name be "item_somethingunique". Item part numbers work
well for the something-unique part of the variable name. "op" variables
must be tagged the same way. "op1_same-unique-as-item". You MUST have the
underscore character after "item" and "op1" for it to be parsed
correctly.<p>

View the source of this document now, and examine example one.<p>

Example one uses check boxes to "turn on" an item for adding to the
cart. It's a really basic example, but note the "name=item_xxxx" convention.
Also notice the </b>input type=hidden name=item value="a-1357"<b>.
The form will work ok without it, but if someone clicks "add to cart"
without checking any boxes, Americart will still know the path to
your account.<p>

Example two uses an op variable. Notice that although the quantity
field of the individual product contains "op1", the actual </b>input
type=text size=2 name=op1_rye value="0"<b> uses op1_rye.
The "rye" matches the suffix of the "item_rye".  Perhaps
we've belabored this point, but it is the only real difference between
single and multiple item submission besides the fact the all items in a
"multi" must be inside a single form /form.<p>

Reminder: DO NOT put "op1_same-unique-as-item" inside the item string
quantity field, just op1. </b>name=item_rye value="a-1357^rye^loaf of
Rye^2.22^op1"<b> See? Just plain "op1" in the quantity field.<p>

There are many ways to structure this method. The
above are just two. You can have select pop-ups, text fields,
radio buttons, or anything you wish, just like the single item method.<p>

<hr>
End of page



<!-- footer starts --><?php include_once($_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"); ?><!-- footer ends --></body>
</html>
