Webii.net Logo
Web Hosting E-commerce Domain Name Registration Design and Development Dedicated Servers
Support
The help you need... Right now!

 

Miscellanous Support

Script Install & Server Customization
Company Customization & Tax Setup
Catalog Page Creation
Try our Demo

 

Script Install & Customization

Installing a shopping cart for your website is easy!

Follow the instructions below to add the script to your site.

1. Create a directory in your cgi-local called shop (or whatever you prefer).

2. Within that directory (shop), create directories called:

  • customers
  • orders
  • catalog
  • tokens
  • temp_customers
  • temp_orders
  • log

3. Make sure you CHMOD all directories (including shop) 755.

4. Download the shopping cart files to your computer.

  • perlshop.cgi
  • index.html
  • page1.htm
  • page2.htm
  • country.htm
  • perllogo.gif

These are the script, a demo entry page, and two demo catalog pages, plus the country code page and two graphics. More on what to do with each of these as we move along.

6. Open the perlshop.cgi file in a text editor (like notepad), and make modifications to the following lines (ensure to change only the lines listed below, as the rest are already preset for your Webii virtual server):

For most settings the possible choices are listed to the right in the comments area. There are many features and variables available for customization in this script, as it is very flexible and very powerful. The following modifications cover the basics, and will enable you to setup a simple, working shopping cart. Feel free to experiment with the other settings, to try and create a more advanced cart. Please note that Webii is not the author of this script and will not be able to troubleshoot issues with its functions. When making changes, it is our recommendation that you back up original files for easier troubleshooting.

Under the Initial Configuration Settings area (scroll down through the script until you see the header):

  • Set $use_cookies to yes if you would like shoppers to be able to leave the store and come back and have the script remember their previous carts.
  • The $cookie_expire_days setting is related to the above, and is defaulted at 30 days.
  • The $allow_fractional_qty setting defines whether your products must be purchased in integer values.

Under the Server Customization Variables area:

  • Change $server_address to your domain name
  • Change $cgiwrap_directory to the directory you created in your cgi-local, i.e. '/cgi-local/shop'
  • Change $cgi_directory
    to the same value as $cgiwrap_directory
  • Change $smtp_addr to your IP#'s (included in your activation e-mail)
  • Change $catalog_home to the directory of the entry page (i.e. '/shopdemo')
  • Change $home_page to the name of the entry page (i.e. 'index.html')
  • Change $image_directory to the directory where you will store your images in the catalog pages, (i.e. '/shopdemo')
  • Change $image_location to the URL of the images, (i.e. "http://yourdomain.com/shopdemo")
  • Change $home_icon to a graphic of your choice (appears on the catalog pages as a link back to the start)

Company Customization & Tax Calculation

Under the Company Customization Variables area:

  • The $banner references the graphic which will display at the top of all your catalog pages. This file should be stored in the htdocs/shopdemo/ directory.
  • The $hspace, $vspace, etc. tags, are the image attributes, size, etc
  • The $company_name, $company_address, etc. tags, are displayed at the bottom of each catalog page
  • Change the @accept_payment_by to suit your needs
  • Change @valid_credit_cards to suit your needs
  • Change $cod_charge to your C.O.D. charge or set to zero
  • Change @Handling_table to match your company's needs
  • Change $Pay_checks_to to your company name or operating name
  • The $return_policy text is printed at the bottom of your receipts and orders. Modify to suit your needs.
  • Change $catalog_country to your home country, and all the local configuration variables following to match.
  • The $shipping_type area allows you to create different shipping options. You can just modify the default info, and add or delete lines as necessary.
  • The $discount_type area allows you to give price or volume discounts.
  • The @Tax_States area allows you to perform dynamic tax calculations.
  • The $stay_on_page switch sets whether the user automatically is checked out after the first order submission or continues to browse the catalog.

7. Upload the modified perlshop.cgi file with FTP to your cgi-local/shop directory. Ensure you upload it in ASCII mode.

8. Upload the temporary index.html file and the graphics files with FTP to your /shopdemo directory. Ensure you upload it in ASCII mode.

9. Upload the temporary page1.html and page2.html files with FTP to your /cgi-local/shop/catalog directory. Ensure you upload them in ASCII mode.

10. CHMOD the script and files 755.

11. Get ready to create some custom catalog pages!


Catalog Page Creation

Note: All the catalog pages will be stored in the /cgi-local/store/catalog directory.

Navigation

You can link to other pages in your catalog through two methods.

The first is to have submit buttons leading to other pages. The code for them is as follows:

<form METHOD=POST ACTION="!MYURL!">
<input type=SUBMIT name=none value="Product 1">
<input type=hidden name=thispage value="page.html">
<input type=hidden name=ORDER_ID value="!ORDERID!">
</form>

Do not change anything here except what is in bold... the !MYURL! and !ORDERID! are created dynamically.

The second method is to plan your pages in a linear fashion, and have a "Previous Page" and "Next Page" style navigation system at the top and bottom of each page. This is accomplished by placing the following tag at the top of each catalog page:

<--PSTAG prevpage=page1.htm nextpage=page3.htm-->

This would be the tag on the hypothetical "page2.htm". For the first and last pages (i.e. page1.htm) you place the page in as the previous or next page to close the line. For example, on page1.htm your tag would read:

<--PSTAG prevpage=page1.htm nextpage=page2.htm-->

This would display only a "Next Page" button. This tag goes at the very top of the page, above the <html> tag. See our online demo for an example.

Item Selection

There are two main type of item forms you can make. They are single-item forms, and multi-item forms. The later is probably the most useful, but you have either type or both types on the same page if you like.

For single item selection, where each item has its own Order button (like the items on our first demo page), you would use the following code:

<form METHOD=POST ACTION="!MYURL!">
<INPUT TYPE=HIDDEN NAME=ORDER_ID VALUE="!ORDERID!">
<INPUT TYPE=HIDDEN NAME=ITEM_ID VALUE="12345">
<INPUT TYPE=HIDDEN NAME=ITEM_NAME VALUE="Item Name">
Item Name/Price
<INPUT TYPE=HIDDEN NAME=ITEM_PRICE VALUE="49.95">
<INPUT TYPE=HIDDEN NAME=thispage value=page1.html>
Qty:<INPUT TYPE=TEXT SIZE=3 MaxLength=3 NAME=QTY VALUE="1">
Blurb on product
<INPUT TYPE=HIDDEN NAME=ITEM_CODE value="!ITEMCODE!">
</form>

Again, the fields you would change are in bold.

For multi-item selection, with one Order button at the bottom (or top, etc.) of the page, you would structure the page as follows (like the second page of our online demo):

<form METHOD=POST ACTION="!MYURL!">

*** Repeat this section for each product ***

<INPUT TYPE=HIDDEN NAME=ITEM_ID VALUE="12345">
<INPUT TYPE=HIDDEN NAME=ITEM_NAME VALUE="Item Name">
Item Name/Price
<INPUT TYPE=HIDDEN NAME=ITEM_PRICE VALUE="49.95">
Qty:<INPUT TYPE=TEXT SIZE=3 MaxLength=3 NAME=QTY VALUE="1">
Blurb on product

*** End Repeated Section ***

<INPUT TYPE=SUBMIT NAME=dummy VALUE="Press to Order">
<INPUT TYPE=HIDDEN NAME=ACTION VALUE="ORDER">
<INPUT TYPE=HIDDEN NAME=ORDER_ID VALUE="!ORDERID!">
<INPUT TYPE=HIDDEN NAME=thispage value=page1.html>
<INPUT TYPE=HIDDEN NAME=ITEM_CODE value="!ITEMCODE!">
</form>

Optional Tags

The following tags are optional:

  • WEIGHT - This 'type=hidden' tag can be used if you want to calculate the shipping charges based on weight. The value of the tag should be the weight of the item. If you want to use this tag you must change the value of the '$weight_caption' variable.
  • TAXTYPE - This 'type=hidden' tag can be used if only some of the items you sell are taxable, and some are not. The default is to add tax, but you can override it for individual items by using the following tag:

<INPUT TYPE=HIDDEN NAME="ITEM_TAXTYPE" value="none">

  • OPTIONx - This tag can be used to specify any attributes of the items you sell. For example, this tag can be used to specify Colour, or Size. You can have up to three different option tags. If you want to use this tag you must change the value of the '$option1_caption' variable to the name of the option. You can let users pick the value of the option through a list box, radio buttons, etc..
  • Stay on Page - By placing this tag within the <form>...</form> block, you can override the value of the '$stay_on_page' variable in the script. For example, the following tag allows the user to stay on the page after hitting Order by selecting the checkbox:

<INPUT TYPE=checkbox NAME="StayOnPage" value="YES">

Tag Order

The order of the tags is very important. The following must be observed:

  • The 'ITEM_COD' tag must be the very last tag before the closing </form> tag.
  • If any of the optional tags are used they must appear before the 'ITEM_ID' and 'ITEM_PRICE' tags.
  • Each HTML tag should be on a line by itself.

Back to Support Home


Copyright (C) Webii.net / WebXess, Inc. Est. 1996.