Welcome to Islandnet.com  
Locally owned and operated since 1993  
Live Help
LOG IN:  Username:    Password:    

Create Store pages

Basic Form Layout

The store page (or pages) is where the customer selects a product to buy and adds it to his or her shopping basket. These are normal HTML files that contain one or more input forms. Each input form can submit one or more products to the shopping basket.

The simplest input form might look like this:

<form method=post action=/cgi-bin/ms2/guest/basket>
<input type=hidden name=p1 value=7.95>
<input type=hidden name=c1 value=M01>
<input type=hidden name=d1 value="Coffee Mug">
<input type=hidden name=q1 value=1>
<input type=submit value="Add to basket">
</form>
The form values have the following meanings:

p1 - Price (a number with NO currency symbol)
c1 - Product code (may not contain spaces)
d1 - Description
q1 - Quantity

The number 1 refers to the fact that it is the first product in the form. If you want to submit a second product to the basket in the same form, simply add p2, c2, d2, and q2 fields. You can submit as many products via a single form as you'd like. They must be sequential though, you can't skip a number (so if you remove a product from the middle of a form be sure and renumber the fields!)

Of course any of the fields could be actual input fields instead of hidden values, although only the quantity value would really make any sense that way.

Adding Product Options

You can add user-selectable options (size, color, etc) by adding two extra fields:

<input type=hidden name=o1-1 value=Color>
<select name=v1-1>
<option value=White>White
<option value=Red>Red
<option value=Green>Green
</select>
o1-1 - The option name
v1-1 - The option value

To add a second option to the same product, use o1-2 and v1-2 and so on. If you have multiple products per form AND multiple options per product the numbering can get a bit confusing, so take your time.

Product Options That Affect the Price

An option can also affect the price of a product. For example, T-Shirts might cost $14.95 in all sizes except XL which is $16.95. Rather than create a separate input form for the XL shirts, simply create an option list that looks like this:

<input type=hidden name=o1-1 value=Size>
<select name=v1-1>
<option value="S">S
<option value="M">M
<option value="L">L
<option value="XL,2">XL
</select>
Note the ",2" in the XL value. That tells the shopping basket to add $2.00 to the price if that option is selected. Note also that you cannot embed commas in an option value because it will be treated like a price adjustment and will NOT be displayed.

Prices Based on Quantity

It is also possible to have products with a price that varies based on quantity. For example, let's say you sell pens. They are priced at $1.00 each in quantities under 500, $0.75 in quantities of 500-1500, and $0.50 in quantities over 1500. All you need to do is change the "p1" field like so:

<input type=hidden name=p1 value="1 0.75,500 0.5,1500">
The shopping basket will automatically calculate the correct price based on whatever quantity the customer chooses.

Shipping and Tax Exemptions

By default every product is assumed to be taxable. You can control (on a per item basis) which products should be included in tax calculations by defining the "f1" field, which stands for "flags". For example, to indicate that a product is exempt from GST and HST calculations, add the following line to the form:

<input type=hidden name=f1 value="gh">
The following flags can be used:

g - Item is GST exempt
h - Item is HST exempt
p - Item is PST exempt
t - Item is Sales Tax exempt (US)
s - Item is exempt from shipping charges

Remember that these "exemptions" are based on the individual items and do not override the basket settings themselves. An example would be; If you've configured your shipping to charge basic shipping for the entire order, setting f1="s" would not affect it. If you were charging shipping strictly based on a percentage of sub-total or by weight, then the items set with f1="s" would not trigger the shipping calculation.

Shipping Based on Weight

If you refer to the config file description you'll note that you can define shipping and handling charges that are based on the total dollars or the total "weight". By default the "weight" of an item is assumed to be zero. To define a weight so that you can calculate weight-based shipping, add a line like the following:

<input type=hidden name=w1 value=10>
The "weight" does not necessarily have anything to do with the physical weight of a product, it can mean anything you want. It is important to note that this number is multiplied by the quantity to calculate the total weight of a product, then added to the weights of all the other products in the basket.

Conditional Additions

There may be cases where you want a product to be added based on the value of another form variable. For example you might require that a customer selects a checkbox or radio button to select a product. You can do this with the "x" parameter, like this:

<input type=hidden name=x1 value="cb on">
If you were to add that line to your form then the product would only get added if there was also a form variable called "cb" and it was set to "on". This extra form variable could have any name you want.

Clickable Product Descriptions

You can optionally provide an URL for each product. If you do then the product description in the basket contents display will be clickable, allowing customers to jump directly to the URL. Simply add a line like this:

<input type=hidden name=u1 value="http://...">
Including Thumbnail Graphics

You can optionally provide an URL for each product that points to an image that will be displayed along side the product description. There is no restriction on image size, although you'll want to use tiny ones so you don't disrupt the "look" and annoy customers. This image will also be clickable if you provided a product URL (see above).

<input type=hidden name=g1 value="http://...">
Display a File When a Certain Product is Added

You can make the shopping basket display a file when a product is added. This might be a notice about the product, or it might be another form that prompts the customer to buy a related product. To do this add a line like this:

<input type=hidden name=i1 value="ms2/special.html">
Now whenever a customer adds one or more of the current product to their basket, the file "ms2/special.html" will be included in the display after the header file and before the actual basket contents.

NOTE: This assumes that you are NOT using the "jump" value to bypass the basket contents display.

Making One Product Dependent on Another

In our demo store you can optionally buy a colour scanner when you purchase a computer system. But what happens if you then delete the computer from your basket? We don't want to sell the scanner by itself, so we create a product dependency which essentially says: if the computer is deleted, also delete the scanner. It's done by modifying the product code for the computer as follows:

<input name=c1 value=COMP01>
becomes

<input name=c1 value="COMP01 SCAN1">
Which means, if "COMP01" is deleted from the basket, then also delete any "SCAN1" products as well. You can list multiple dependencies by separating them with a bar like so:

<input name=c1 value="COMP01 SCAN1|PRINT1|SPKR1">
Overriding the Continue Button

In the config file you defined a default URL to send the customer to when they click the "Continue" button while viewing the basket contents. There may be times when you want to override this default and have them go to another URL. You can override the CON config option temporarily by adding one hidden value to your input form like this:

<input type=hidden name=continue value="http://...">
Skipping the Basket View

If you don't want the customer to have to view the basket contents every time they add something, you can add another hidden form field that will cause them to jump to another URL immediately after adding something to their cart. Like this:

<input type=hidden name=jump value="http://...">
Using an Alternate Config File

If you need to use multiple shopping baskets in the same account, you will most likely want to use a different config file with different settings. To accomplish this all you need to do is add one extra hidden form value to each input form that calls inBASKET (including the order form itself!):

<input type=hidden name=store value="mystore">
In the example above inBASKET would use "ms2/mystore.cfg" instead of the default "ms2/basket.cfg". Note that you do not specify the directory or the ".cfg" extension.

Form Variable List

This is a list of all the form values you might use. The capital X should be replaced with a different number for each product listed in the form, starting at 1. The capital N should be replaced with a different number for each product option, starting at 1. Any other form values will be ignored, unless it is referenced in a xX value.

dX - Product description (required)
cX - Product code (required)
pX - Product price (required)
qX - Quantity (required)
oX-N - Option name (optional)
vX-N - Option value (optional)
fX - Tax/Shipping flags (optional)
wX - Product "weight" (optional)
xX - Condition required to add product (optional)
uX - Clicking on the description will jump to this URL (optional)
gX - An URL that points to a thumbnail product graphic (optional)
iX - The name a file to include above the basket view (optional)
continue - Overrides the CON setting (optional)
jump - The URL to jump to instead of viewing the basket (optional)
store - A config file prefix to use instead of "basket" (optional)

Miscellaneous Info

Sometimes it is convenient to have a link or button that doesn't actually add anything, it just takes the customer to the basket view page. You can do that like this:

<a href=/cgi-bin/ms2/guest/basket>
It is possible to embed a running total of the current basket contents in any html page by inserting something like this:

<!--#exec cgi="/cgi-bin/ms2/guest/basket/total" -->
That code will be replaced with the current dollar total of the basket contents. The value displayed does not include any shipping or tax calculations.

Likewise you can embed the current number of items in the basket using the following code:

<!--#exec cgi="/cgi-bin/ms2/guest/basket/items" -->
Note that this will show the total number of individual items, not the number of unique products. To do that use this code instead:

<!--#exec cgi="/cgi-bin/ms2/guest/basket/products" -->
All three of the above features (total, items, and products) can be restricted to count only entries matching a specific product code by appending "/?code=CODE" to the URL like this:

<!--#exec cgi="/cgi-bin/ms2/guest/basket/total/?code=M001" -->
<!--#exec cgi="/cgi-bin/ms2/guest/basket/items/?code=M001" -->
<!--#exec cgi="/cgi-bin/ms2/guest/basket/products/?code=M001" -->
In some cases you may want to provide a link that bypasses the basket contents and goes straight to the order form:

<a href=/cgi-bin/ms2/guest/basket/?action=Submit+Order>Proceed to the Checkout</a>
Note that you would replace the "Submit+Order" part with whatever value you specified for BPO in the config file. Don't forget to change any spaces to plus signs.

Used in combination with the "jump" feature you can implement "Buy One Now" scenarios where the customer can buy a single item immediately without going through the basket display process.

<< BACK



Page generation time: 0.02 seconds