Bread Store Example

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.

Try our wonderful bread! Check all you'd like and click on "add to cart"


Rye Loaf
Wheat Loaf
Oat Loaf
White Loaf
Honey Loaf


Rye Loaf
Wheat Loaf
Oat Loaf
White Loaf
Honey Loaf



In the above examples, 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.

We discourage you from building large, single page order forms with all your products on it, although it will work just fine from a technical point of view as far as virtualCART® 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.

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.

View the following examples for details.

EXAMPLE ONE


[VIEW HTML CODE HERE]


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 input type=hidden name=item value="[cart-id]". The form will work ok without it, but if someone clicks "add to cart" without checking any boxes, virtualCART® will still know the path to your account.

EXAMPLE TWO

[VIEW HTML CODE HERE]


Example two uses an op variable. Notice that although the quantity field of the individual product contains "op1", the actual input type=text size=2 name=op1_rye value="0" 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>.

Reminder: DO NOT put "op1_same-unique-as-item" inside the item string quantity field, just op1. name=item_rye value="[cart-id]^rye^loaf of Rye^2.22^op1" See? Just plain "op1" in the quantity field.

There are ALOT of ways you can structure this method. The above are just two. You can have select pop-ups, text fields, radio buttons, anything you wish, just like the single item method.

 

Can't find the answers you are looking for in this section?  Please don't hesitate contacting our support staff by submitting a support ticket.