dot pictureservices picturedot picturesupport picture
dot picturecontact picturedot pictureabout picture
dot picturehome picture





Today's Discussion
Create New Topic
List by Topic


Excite Search
Atomz Search:

Advanced Atomz

The Shopping Cart

This product is best for catalogs of less than 100 items. For larger catalogs, performance and manageability can be an issue.


The Shopping Cart program allows visitors to your on-line shopping site to collect items in a virtual shopping cart. They may view the contents of their shopping cart at any time and may add or delete items at will. The program automatically calculates the subtotal, sales tax, shipping charges, and grand total. When a visitor decides to check-out, the order information including the buyer's name, address and billing instruction is e-mailed to your order department (or whomever you choose) and a receipt is sent to the shopper.


  • Mails order to one or two e-mail addresses
  • Sends receipt to customer
  • Accommodates up to four types of shipping
  • Allows owner to predefine sales tax based a specific state
  • Tracks purchases even if user clicks the back button
  • Tracks each customer by Shopper ID (SID) (does not use cookies)

What This Program Does Not Do

  • It cannot keep track of a visitor if the visitor leaves the site
  • It does not calculate exact shipping costs. It can calculate a base rate plus an additional charge per item, based on up to 4 different shipping methods that you create. However, it cannot calculate shipping charges based on weight, size, or zone.
  • It does not perform on-line payment. It can be integrated with an on-line payment program such as Cybercash or First Virtual, but these are not included in the Shopping Cart script.
  • It does not securely transmit credit card payment information. You can use our SSL server to safely transmit the credit card and order information from the customer to our computers, but the resulting order that is e-mailed from the Shopping Cart script to the person(s) you specify is not secure. You may wish to have users print the generated order form and mail or fax it to you.


The Shopping Cart is actually quite easy to implement. You do not need to know PERL or any other programming language and you don't need to be an expert webmaster. Just follow the simple steps outlined below and you should be up and running in no time.

  1. Install the Shopping Cart software
  2. Edit the configuration file
  3. Create your product list
  4. Modify your web pages to include the shopping cart feature

Note: You may wish to print out this page so you can follow along as you work through each of the steps.

Hassan Consulting's documentation

1. Install the Shopping Cart Software

To install the shopping cart software within your web site:

  1. Access your account Control Panel
  2. Select Shopping Cart Generator
  3. Click the YES button to install files

CAUTION! This will cause any existing version of this shopping cart to be over-written.

The installation will create a subdirectory within your web site called /shop which contains several HTML files used in a demonstration as well as a /lists directory and a /tmp directory which are used by the Shopping Cart program. A shopping cart script ( and a configuration file (shop.cfg) will be placed within your /cgi-local directory. After installation, a prompt will appear to refer you to the newly installed demonstration within your web site.

Demo files inside /shop/
Use these files as an example.
You may delete them when you
create your own pages.
cdrom.html, done.html, email.html, harddrives.html, list.html, modem.html, shop.html, tapes.html, product_list.txt, /picts/ (images used in demo)


2. Edit the configuration file

2a. Download the Configuration File

Use an FTP program to download the newly installed Shopping Cart configuration file (shop.cfg) to your computer. The file is located in your /cgi-local directory.

Be sure to download the shop.cfg file in ASCII transfer mode (not binary mode).

After the configuration file is downloaded to your computer you can edit it with any text editor of your choice, such as Notepad, WordPad, or TeachText. Just remember to save your edited version as a 'text only' document and make sure you keep the file name the same.

2b. Specify to what e-mail address(es) you want the order to be sent.

As mentioned, the Shopping Cart script has the ability to mail orders to one or two e-mail addresses. These addresses are specified within the shop.cfg file in a section titled '# mailing info' as shown below:

# mailing info

$admin = ''; # who to mail the order to $admin1 = ''; # second person to mail the order to

Type the e-mail address of the person to whom you want the orders sent between the pair of single quotes following the $admin variable names as in this example:

# mailing info

$admin = ''; # who to mail the order to $admin1 = ''; # second person to mail the order to

To specify a single email address, merely leave the second variable empty.
IMPORTANT! You MUST keep the single quotes surrounding the email addresses.

2c. Specify the Sales Tax Rate for your State.

The Shopping Cart script will automatically calculate the Sales Tax for an order provided you specify the two letter postal code and tax rate for your state. If the two letter postal code in the billing address of a user matches the postal code you specify, then the appropriate sales tax will be added to the order according to the tax rate you specify. The sales tax is specified within the shop.cfg file in a section titled '# current tax rate and states' as shown below:

# current tax rate and states

$tax_state = "FL"; # State in uppercase $tax_state2 = "fl"; # State in lowercase $tax_rate = ".06"; # 6 %

Change the "FL" and "fl" in the $tax_state variables to the two letter postal code for your state. Change the ".06" in the $tax_rate variable to the current sales tax rate in your state. For example, if your sales tax is 5.5%, you would edit the $tax_rate variable to read: $tax_rate=".055";

2d. Specify the Shipping Charges you wish to use.

The Shopping Cart program can accommodate up to four types of shipping charges that you specify. Each of these charges is calculated using a simple base charge plus an additional charge for each item ordered. The shipping section is located at the end of the shop.cfg file as shown below:

# Set your shipping cost here # # set to "" to turn off shipping # set to "" to turn off one kind of shipping # values for shipping types $shipping1 = "upsground"; $shipping2 = "upsred"; $shipping3 = "upsblue"; $shipping4 = "international"; # labels for shipping types $shipping_label{$shipping{1}} = "US Mail"; $shipping_label{$shipping{2}} = "UPS Red"; $shipping_label{$shipping{3}} = "UPS Blue"; $shipping_label{$shipping{4}} = "International"; # descriptions for shipping types $shipping_desc1 = "Regular US Mail"; $shipping_desc2 = "Delivery in 2 business days"; $shipping_desc3 = "Next Day Delivery"; $shipping_desc4 = "International Delivery"; # default shipping type $shipby = "";

If you only want 2 shipping types: $shipping1 = "upsground"; $shipping2 = "upsred"; $shipping3 = ""; $shipping4 = ""; These appear on the order email Change these to whatever you want your ordering department to see on the form as the shipping type These are the choices the customer sees on the order page. Change these to whatever you want the customer to see as the shipping types. Use one of the shipping 'values' $shipby = "upsground";


The actual shipping 'base' and 'rate' charges are specified at the end of the shop.cfg file as shown below:

$shipping_base{$shipping{1}} = "6.51"; $shipping_rate{$shipping{1}} = "<font color="#FF0000">.49"; $shipping_base{$shipping{2}} = "18.31"; $shipping_rate{$shipping{2}} = "<font color="#FF0000">.69"; $shipping_base{$shipping{3}} = "8.66"; $shipping_rate{$shipping{3}} = "<font color="#FF0000">.59"; $shipping_base{$shipping{4}} = "100.00"; $shipping_rate{$shipping{4}} = "<font color="#FF0000">50.00";

The first two lines determine the first set of shipping charges, the second pair of lines determine the second set of shipping charges, and so on. You only need to change the dollar amounts within the quotes for each pair of base and rate shipping charges. Use the following examples as a guide to setting the shipping charges.

Single charge of $10.00 for total order:

$shipping_base{$shipping{1}} = "10.00"; $shipping_rate{$shipping{1}} = "<font color="#FF0000">0.00";

Flat rate of $5.00 per item:

$shipping_base{$shipping{2}} = "0.00"; $shipping_rate{$shipping{2}} = "<font color="#FF0000">5.00";

$5.00 base charge plus an additional $2.50 per item:

$shipping_base{$shipping{3}} = "5.00"; $shipping_rate{$shipping{3}} = "<font color="#FF0000">2.50";

$15.00 for first item plus $4.00 for each additional item:

$shipping_base{$shipping{4}} = "11.00"; $shipping_rate{$shipping{4}} = "<font color="#FF0000">4.00";

The last example is a little tricky. The first item would be charged $11.00 plus 1 x $4.00 = $15.00. Each additional item would add an additional $4.00 to the shipping charge.

Note: this program cannot calculate shipping charges based on weight, type of item, zone, country, or shipping tables.

2e. Upload the Configuration File

After you have finished making the necessary changes to your configuration file and have saved it as a plain text file, use your FTP program to upload this file (shop.cfg) back up to your /cgi-local directory.

Be sure you keep the file name shop.cfg when you save your changes.
Be sure to upload the shop.cfg file in ASCII transfer mode (not binarymode)

[To continue configuring your shopping cart, click here to goto Steps 3 & 4]

Prev | Next | The Shopping Cart

A metaphor. A philosophy. A way of doing business.

Copyright 1997-2001 - Last update: Wednesday, March 21, 2001 at 2:08:19 PM