CHAPTER FIFTEEN - SHOPPING CART
15.1) Introduction
The Web Store is a program written in Perl, and based on the widely
used shopping cart written by Selena Sol. It will allow you to display
and sell products on the Internet.
Please note that this software is provided as is with no warranties
or guarantees. You use this software at your own risk, and Virtual Web
Communications is not responsible for any loss or damage that may arise
by using the script. Note also that BEFORE OPENING YOUR INTERNET STOREFRONT
you should fully test your site to ensure that it is working correctly.
You can see an example of the shopping
cart and you can order the installation of the script by e-mailing
us at support@vwcom.net
15.2) Setting Up Your Shopping Cart
There are four steps involved in setting up your Shopping Cart.
# You must decide if you will be charging sales tax, and if the
sales tax will be charged for only the customers in your own state. You
will also be asked what directory name you want to create for your shopping
cart. If you choose something like webstore, then the URL for your
shopping cart will be http://yourdomain.com/webstore, and you will
access your store manager at http://yourdomain.com/webstore/manager.cgi.
Finally the shopping cart store manager requires a username/password combination
to allow you to securely access and modify your store's products. Make
sure you save this information.
All of the variables that need to be set for the Shopping Cart are
in the setup file in the main shopping cart directory. You can edit
these values to suit your needs.
-
Next you should separate your products into categories. The software will
display each category on a single HTML page. For example, if you have a
category called "printers", then all printers will be displayed on a single
Web Page constructed by the software.
For each product you will need the following information.
-
Product ID A unique product number or code.
-
Category The product category.
-
Price The (unit) price of the product.
-
Shipping The (unit) cost of shipping and handling.
-
Name The product's name.
-
Image An image URL if you want to display a picture of the product.
-
Description An HTML entry describing the product in detail.
-
The most difficult part of creating the shopping cart is creating the HTML
pages of your catalogue. These pages provide a directory so that customers
can navigate to the product pages where products belonging to a specific
category will be displayed. The catalogue pages must be created using specific
rules, and the pages must be placed in specific directories for the software
to work correctly. This is explained in detail below.
-
The final step to creating your Web Store is to add the data to your database.
The database is pipe (|) delimited, and resides in the data.file file in
the Data_files subdirectory of the main shopping cart directory. You can
upload the file in that format according to the description of the fields
given above. You can also modify and add records using the Store Manager.
15.3) Creating Your Catalogue Pages
All of the Web pages that you need to create for your catalogue must be
placed in the Html directory of your Shopping Cart main directory.
This sub-directory is used to hold various HTML documents that are used
to provide navigation-like functions including the frontpage, order form
and list of product pages.
Here is quick list of the file organization :
-
The Front Page of your web store must be stored in index.html in the Html
subdirectory.
-
The order form (which requests personal information (address, etc.) after
the customer has selected items for purchase) must be orderform.html. NOTE
: DO NOT CHANGE THE FORM VARIABLE NAMES for the order form or the Shopping
Cart will not work! However, you may change the form's appearance and the
values that may be entered by the customer.
-
Images is a sub-directory containing images used by the shopping cart.
There are two ways to reference an image. In the database all images must
be referenced using a URL such as
< IMG SRC = "Html/Images/four.gif" ALIGN=CENTER >
Note that Html/Images/ must precede the name of the graphic file. If no
image is available, you may put text indicating that there is no image
available. To leave this field blank on the display, put <!-- comment
-->. Since the software will create an HTML table from the database, the
image field will be "commented out" using this approach.
When referencing an image in an HTML page, use an image markup like
<IMG SRC = "Html/Images/ws-front.gif">
-
Products - This subdirectory contains pre-designed HTML pages which the
store may be asked to display during shopping. For large catalogues, this
directory will contain pages with links to other pages. Secondly, this
sub-directory contains "list of product" pages which are simply HTML pages
which contain hyperlinks to "product pages". For example, the front page
may reference a page (sections.html) in the products directory by
< A HREF = "web_store.cgi?page=sections.html&cart_id=">
IT IS EXTREMELY IMPORTANT THAT YOU REFERENCE THESE PAGES USING THE EXACT
SYNTAX GIVEN HERE! ... the only thing you need to change is the file name.
15.4) Using the Store Manager
The Shopping Cart manager allows you to manage the data in your database
as well as upload (and download) catalogue pages and images providing you
use the Netscape browser. In order
to access the store manager, it is necessary to provide the username/password
combination which you selected when the Shopping Cart was ordered. You
may also add additional manager username/paasword combinations if more
than one person will be managing the store. To do this, edit the "setup"
file in the main shopping cart directory. Change the $ZADD variable from
"off" to "on".
The major point that must be made about the database is that each field
will be displayed in an HTML table, and therefore, each field may be modified
with HTML directives. Of particular interest is the Image field
which must have the following format :
< IMG SRC = "Html/Images/four.gif" ALIGN=CENTER >
Note that all images should be uploaded to the Html/Images subdirectory
of the main Shopping Cart Directory.
Back to the Table of Contents