How to create your web pages
Your first page of your Shopping Cart site will be a normal HTML page. In it you need a link like this: /cgi-local/shop.pl/page=start.html This tells the Shopping Cart to display the page "start.html". In this page, "start.html", you must have links like this: /cgi-local/shop.pl/page=modem.html/SID=PUT_SID_HERE. This allows the Shopping Cart to keep track of the user even if they back up to your start page. You must include the token PUT_SID_HERE in all URLs inside your Shopping Cart web site.

Tokens you can insert in your HTML All HTML files inside a Shopping Cart site are parsed by the Shopping Cart program. The HTML files are parsed for the two tokens below and the token replaced with the infomation requested. These tokens can be in any HTML file in the Shopping Cart site.

Tokens and their descriptions

PUT_SID_HERE This token inserts the shopper ID into the HTML file being displayed. It must be used in all URLs inside Shopping Cart website.

For example: /cgi-local/shop.pl/page=shop.html/SID=PUT_SID_HERE

PUT_SHOPPING_LIST_HERE This token inserts the shopping list into the HTML file being displayed.

PUT_SHOPPING_LIST2_HERE This token inserts the shopping list into the HTML file being displayed minus the shipping type selection boxes. This is intended to be used on the email form page as a receipt.

PUT_SEARCH_RESULTS_HERE This token inserts the results of a search that was done on the previous page.

PUT_BUY_INFO_HERE This token shows the customer what they just purchased.

PUT_STATE_HERE This token will insert the state if the customer has checked the checkbox that says they live in same state as the shipper. This is meant to be used on the email.html page or the final checkout page.

PUT_ZIP_HERE This token will insert the zip code if the customer has filled out the zip code box on the shop.html page. This only works when UPS shipping charts are enabled. This is meant to be used on the email.html page or the final checkout page.

MY_URL This token will insert the path of the shop.pl program in your HTML. The value it inserts is controlled in the shop.cfg file by the $MY_URL variable. You can use this to insert the PUT_SID_HERE also, since it is required in all URLs inside the cart anyways. This was added in version 1.16.

The following tokens only work on the final checkout page. They are intended to populate a payment form. (i.e. paypal.com payment form) These tokens only work on version 1.54 or higher.

The following tokens only work when you set show_customer_data equal to 1 or mail equal to 1 in the URL calling the page that is being parsed. They are intended to populate the email form after a customer has entered their email address and password to login. These tokens only work on version 1.56 or higher of the cart.

URL Path Information Information is passed to the Shopping Cart via the URL the majority of the time. The only time this is not true is in the email page and in the shopping list form or when you are using the option to buy item with a form. There are three ways to pass information to the Shopping Cart program. You can use any of these methods to pass infomation to the cart. Windows NT IIS SP6 only works with the GET and POST methods.

Examples of the three methods:

  1. SLASH Method
    /cgi-local/shop.pl/page=shop.html/buy=1/SID=PUT_SID_HERE/item=90

    The variables are passed to the Shopping Cart as an extension to the URL. Everything up to the shop.pl is a normal URL. Everything after that are variables names and variable value pairs. These pairs are seperated by "/". The names and values are seperated by "=".

  2. GET Method
    /cgi-local/shop.pl?page=shop.html&buy=1&SID=PUT_SID_HERE&item=90

    The variables are passed to the Shopping Cart as an extension to the URL. Everything up to the shop.pl is a normal URL. Everything after that are variables names and variable value pairs. The end of the URL is terminated by the "?" symbol. These pairs are seperated by "&". The names and values are seperated by "=".

  3. POST Method
    <form action="/cgi-local/shop.pl" method=POST>
    <input type=hidden name=sid value="PUT_SID_HERE">
    <input type=hidden name=page value="shop.html">
    <input type=hidden name=buy value="1">
    <input type=hidden name=item value="90">
    </form>


    With this method you need to use standard HTML form variables to pass information to the cart.

Description of the variables that can be passed to the shopping cart program

page: This variable contain the name of the next HTML page to parse and send back to the client's browser. This HTML file must be in the shopping_root directory

buy: This variable controls the number of items a user is purchasing.

SID: This is the Shopper ID of the user. Must always be equal to "PUT_SID_HERE" You should always have this on every URL in you Shopping Cart site. This keeps track of what the user has ordered.

item: The Item ID of the product desired to be ordered. (Should match an entry in the cart database file.)

recalculate: Made equal to "1" when the user wishes to recalculate the total cost of their shopping cart.

empty: Made equal to "1" when the user wishes to empty their cart.

mail: Made equal to "1" when the user wishes to mail in their address information. This mails the administrator with the user's order information.

Information on using the Shopping Cart with Forms

Specifying Size and Color

Using a form you can specify two additional parameters to the Shopping Cart. These are color and size.

Below is the HTML code for taking advantage of the shopping cart with forms:

<FORM METHOD="post" ACTION="/cgi-local/shop.pl/page=cart.htm/SID=PUT_SID_HERE/buy=1">
<INPUT TYPE="hidden" NAME="item" VALUE="1">
<SELECT NAME="color">
<OPTION>Red
</OPTION>
<OPTION>Blue </OPTION>
<OPTION>Green </OPTION>
<OPTION>Purple </OPTION>
<OPTION>White </OPTION>
</SELECT>
<SELECT NAME="size">
<OPTION>XS(3-4)</OPTION>
<OPTION>S(5-6) </OPTION>
<OPTION>M(7-8) </OPTION>
<OPTION>L(10-12) </OPTION>
<OPTION>XL(14)</OPTION>
</SELECT>
<INPUT TYPE="image" SRC="/basket/gifs/buy.gif" BORDER="0">
</FORM>

Copy this fragment of HTML code to use the forms option with the Shopping Cart. To use the forms option without size and color, just omit them. To use just one, just use only size or color.


Ordering more than one item at a time using forms

When allowing more than one item to be purchased at a time specify the page and SID arguments on the form ACTION as normal.
For the item tag use this naming scheme: item1, item2, item3, etc... Use each different item number for a different item you are putting up for your customers to purchase. The different item numbers are used so you can use this scheme with radio buttons.

For the buy tag use this naming scheme: buy(item #). For example let's say you are offering item number 4 for sale. Use a hidden tag named buy4 to specify the number of item number 4 that will be purchased. You can also use this variable as a text type variable, so your customers can specify the number of this item they want.

Example code:

<FORM METHOD="post" ACTION="/cgi-local/shop.pl/page=shop.html/SID=PUT_SID_HERE">
<b>Build a computer system</b><br>
<input type=hidden name=buy5 value=1>
<input type=hidden name=buy7 value=1>
<input type=hidden name=buy8 value=1>
<input type=hidden name=buy9 value=1>
<input type=hidden name=buy6 value=1>
<input type=hidden name=buy10 value=1>
<input type=hidden name=buy11 value=1>
<INPUT checked TYPE="radio" NAME="item" VALUE="5">Pentium 166<br>
<INPUT TYPE="radio" NAME="item" VALUE="11">Pentium 200MMX<br>
<br>
<INPUT checked TYPE="radio" NAME="item1" VALUE="7">14" Sony Monitor<br>
<INPUT TYPE="radio" NAME="item1" VALUE="8">17" Sony Monitor<br>
<INPUT TYPE="radio" NAME="item1" VALUE="9">20" Sony Monitor<br>
<br>
<INPUT checked TYPE="radio" NAME="item2" VALUE="6">ATI Video Card<br>
<INPUT TYPE="radio" NAME="item2" VALUE="10">Trident Video Card<br>
<br>
<INPUT TYPE=submit ></FORM>