##############################################################################
# Digital PressWorks ShoppingCart Version 1.0
# Copyright 2003 Digital PressWorks
# Coded by Matt Champneys. Please direct comments or bug reports to
# info@digitalpressworks.com
#
# By using this code you agree to hold Digital PressWorks free from any
# liability that might arise from it's use. You may not sell or
# redistribute this code without prior written consent from Digital PressWorks
Digital PressWorks ShoppingCart is an e-commerce shopping cart system that is easy to integrate into any web site. Below are just some of the features:
Searchable database
Drop down options that can add to price and shipping weight when selected
Free form options for collecting custom information
PayPal compatible
Authorize.net compatible
WorldPay compatible
Administration login
Searchable order management database
Order status tracking
Print packing slips
Create backorders
Send shipping confirmations with package tracking numbers
Add, edit and delete product information
Upload product photos
Manage shipping tables and tax tables
Sales Reports
Necessary Installation Skills:
####################################################################################
To install this script you will need a basic understanding of HTML, Perl CGI scripts and how they work.
Installation Help
###################################################################################
Digital Pressworks offers inexpensive, guaranteed installation service. See our web site at http://www.digitalpressworks.com/installation.html for more details. A FAQ for this script is available at http://www.digitalpressworks.com/cartfaq.html. Although we cannot guarantee responses to questions relating to this free script, you may also direct additional questions to info@digitalpressworks.com
Script Customization
###################################################################################
We can make customizations to the script for you at a very reasonable hourly rate. Contact us at info@digitalpressworks.com for more information.
System Requirements
###################################################################################
Digital PressWorks Shopping Cart uses text files to store data. It does not require an external database such as SQL to function. The program only requires a Unix or Windows based web server with Perl installed to run. If you plan to use an Authorize.net compatible service or to store credit card information and run the transactions manually later you will need the ability to access the script through a secure server. PayPal has it's own secure server to encrypt credit card data.
Installation:
#####################################################################################
The following files are included in this ZIP download:
cart.cgi
admin.cgi
review.cgi
cartconfig.pl
template.html
readme.txt
You will need to know the following things about your hosting service before you can install the shopping cart.
1) Whether the server hosting your web site is Unix or Windows based
2) If the system is Unix based you will need to know:
The path to Perl
The path to sendmail
3) If the server is Windows based you will need to know:
An IP address or domain name for an available SMTP server
The scripts are in Unix text format. If you open them with a text editor like Windows Notepad, you may see strange characters. These are Unix newline characters. You will need to use a good HTML editor that translates Unix characters in order to modify the scripts properly. Windows WordPad will work in a pinch. The Unix formatting is required for most Unix servers and Windows servers interpret the Unix characters just fine. That is why the scripts are in this format.
If you are hosting the shopping cart on a Unix server you will need to check the top of each CGI script to make sure the path to Perl is set correctly.
Open up cartconfig.pl in a text editor and modify the variable definitions at the top of the script to match your installation needs. Detailed explanations for each variable are embedded in the script.
While filling in the values for the configuration variables you will notice the necessity of two folders.
The Photo Folder is where you will store uploaded JPG images of your products. This folder must be web accessible so that the photos can be displayed. Obviously, the script must be able to write to this folder as well.
The Working Folder is where you will store all the shopping cart data. The data is secure by storing it in a lower level folder named with the data key you enter in the cartconfig.pl file. For this to be effective, directory browsing must be turned off on your web server. Obviously, the script must be able to read and write data to this folder as well.
template.html is a normal HTML file and serves as a display "wrapper" for the content displayed by the cart. Wherever you want the script information to appear on your pages you must insert the following tag:
[main content]
The tag is case sensitive.
Note that any images or linked stylesheets need to use full secure URLs if you are going to use a secure server.
The example template.html file included with the ZIP contains an example stylesheet embedded into it. The program only makes use of one stylesheet class for the tables that display the small images of the products. The rest are only definitions of basic HTML tags. Note that all of the tags defined in the example stylesheet are used in the program.
On Windows servers you may need to rename the .cgi scripts so that they have an extension of .plx or .pl depending upon how Perl is configured on your server. .plx is usually preferable because it normally references the ISAPI Perl dll and will run faster and more efficiently. Make sure to reflect the change in the definition variables in the cartconfig.pl script.
On Unix servers you will need to set file permissions on the scripts that need to execute. Required permission settings can vary from server to server, but normally you will set the files and folders as follows:
cart.cgi 755
admin.cgi 755
review.cgi 755
cartconfig.pl 644
template.html 644
cartdata 777
photos 777
Using The Script
##############################################################################################
Once you have successfully installed the scripts you will need to add some products to your store. Start by accessing the admin.cgi script at the URL where you have placed it. Once you log in you will be able to add products, configure shipping and tax information, etc.
After you have a few products you may access the cart.cgi script which will display a form with various search options. Browsing the store will give you a better idea of how it all works.
Connecting with an Authorize.net Compatible Gateway
#############################################################################################
In order to use an Authorize.net compatible service to process credit cards, you must have access to the script on your site through a secure server. You must also use the full secure URL to the cart.cgi program in the cartconfig.pl file where it asks for a secure URL.
Before you can connect, you must establish an account with Authorize.net or a company with a compatible gateway. Once you are able to log into your account there are several things you must do and set up there.
Relay Response should be set to the full secure URL to the admin.cgi program.
Response/Reciept URLs should also be set to the full secure URL to the admin.cgi program.
You must obtain a Transaction Key and enter it into the payment option settings in cartconfig.pl.
You may need to adjust the server time clock settings to synch up with Authorize.net servers. You can do this by adjusting the value of the Authorize.net time offset variable in cartconfig.pl
Settings for how you would like Authorize.net to approve and process cards can all be controlled from within your Authorize.net login.
Linking to Digital PressWorks ShoppingCart
#############################################################################################
A nice feature of this program is the ability to link to any product or product category
externally or internally. A sample link would look like this:
Click here for pink sneakers!
"action=link" tells the program that this is a direct link and "product=25" tells it which product
to display.
Product numbers are generated internally by the shopping cart program and the way to tell the product number is to look at the URL in the address bar of your browser while viewing a product page. In fact, you may copy and paste this URL out of your address bar to use as your link. HOWEVER, you must remove a part of the URL that defines the user or you may run into trouble. Remove any part of the URL that looks like this:
&uid=[some number]
uid is the user identification number of a user. This number is generated by the shopping cart program. But if you force the user ID by leaving this parameter in your URL, everyone using that link will be identified as the same user and will view the same shopping cart! Not good.
Below is a sample of how to link to a product category:
Pink Shoes
"action=search" tells the program that this is a search across the products in the store.
"category=Pink+Shoes" tells the program that it's search should only display products in the "Pink Shoes"
category. Note the use of the +. Netscape will not process a space in a URL so if you want your link to work on Netscape, use a + in place of a space.
The product description fields will accept HTML code so you can imbed these types of links into
the description of your products. For example, on the page displaying pink sneakers you might
want a link to yellow sneakers or to all shoes.
This also enables a web developer to create main categories with static HTML pages (good for search engine spiders) and then link to sub categories created within Digital PressWorks ShoppingCart.