--------------------------------------------------------------------- 1. INTRODUCTION --------------------------------------------------------------------- This script is designed by Virtual Focus, Inc. (http://www.virtualfocus.com/) to help manage coupons for the Virtual Card shopping cart. This program was developed with PERL and could run Windows NT and Unix webservers. Follow the section below for the appropriate operating system to install the virtualCOUPON program. --------------------------------------------------------------------- 2a. HOW TO INSTALL UNIX USING FTP --------------------------------------------------------------------- 1. Unzip zip file to your local hard drive. 2. Edit the first line of the coupon.pl script (the line beginning with #!) and make sure it's pointing to the correct location to perl. You may have to ask your web administrator for this information. 3. FTP the coupon directory to your cgi-bin on your web server 4. Set the following permissions to these files. cgi-bin/coupon | - 755 coupon.pl | - 644 data/ | - 644 data/coupon.db 5. Edit coupon.cfg Change cart ID to your cart ID Change Homepage URL to your homepage URL Change UID and password Skip to Section 3 --------------------------------------------------------------------- 2b. HOW TO INSTALL ON WINDOWS NT WITH IIS --------------------------------------------------------------------- Perl must be installed on Windows NT for this program to work. Only the administrator can install it. If perl isn't installed on your Windows NT webserver, ask your ISP or administrator to install it. To install Perl on Windows NT with IIS: 1. Download Perl from ActiveState at http://www.activestate.com/ActivePerl/download/APi522e.exe 2. Once it is downloaded, run the installer and just follow the prompts. All of the defaults are fine. After perl has been installed, you can install the coupon program on your website. 1. Unzip virtualCOUPON zip file 2. Edit coupon.cfg Change cart ID to your cart ID Change Homepage URL to your homepage URL Change UID and password 3. Make a directory called "coupon" in the cgi-bin of website. 4. Transfer everything into this directory Your administrator or ISP will have to complete the rest of the installation: 1. Start the Internet Service Manger for IIS 2. Use the interface to locate the "coupon" directory, right click on it, get Properties, and make sure the permissions are Execute (at the bottom of the dialog) 3. Use the interface to locate the following files and folders inside coupon, get Properties on it, and make sure the files have the following access permissions. coupon.pl - Execute data/ - Write data/coupon.db - Write --------------------------------------------------------------------- 3. HOW TO INSTALL INTERFACE ON virtualCART --------------------------------------------------------------------- Under Advanced, in Custom Message, add code to cart configuration:
Don't forget to replace the form action with your URL to the script. --------------------------------------------------------------------- 4. TESTING AND LOGGING IN --------------------------------------------------------------------- To test and see if the script can execute, go to the URL: http://www.yourdomain.com/cgi-bin/coupon/coupon.pl You should be greeted with a screen prompting you to enter your coupon code. If you get an error, please review the error and retrace your steps that you took to install the script. Logging into script: Add ?admin to the end of the virtualCOuPON script URL like so: http://www.yourdomain.com/cgi-bin/coupon/coupon.pl?admin --------------------------------------------------------------------- 5. EDITING THE TEMPLATES --------------------------------------------------------------------- Each template is basically an HTML file with special variables. Here is what each file in the templates directory correspond to: discount.html - EDIT THIS TEMPLATE TO SUIT YOUR SITE. Default page that allows the user to redeem their coupon. This template is used if http://www.yourdomain.com/cgi-bin/discount/discount.pl is entered into the URL discount2.html* - * DO NOT EDIT THIS PAGE. After a successful login, this page will redirect the customer to the view cart page. badlogin.html - EDIT THIS TEMPLATE TO SUIT YOUR SITE. when user fails to enter the right coupon number, they are taken to this page. admin_login.html - the template that is used when the URL http://www.yourdomain.com/cgi-bin/discount/discount.pl?admin is entered. error.html - the template that the script uses to display errors. Template variables: = cart ID = discount type = Coupon code = amount of discount = homepage URL (as set in discount.cfg) --------------------------------------------------------------------- TROUBLESHOOTING --------------------------------------------------------------------- Q. What is a key file? The keyfile is generated when a person logs into the administration area of the discount script. It helps the script maintain who is currently logged into the script so that 2 people do not overwrite each other's work. Q. I've encountered "500 Internal Server Error". Did I do something wrong? This could mean many things. Most often, it's because the permissions for the files weren't set correctly. Please review the INSTALLATION guide and make sure every step has been done. Also, if your web server provides error logs, it's a good idea to check it because most web servers will log a more detailed error there. Q. I get the error message "This program can't find coupon.cfg in /usr/local/etc/httpd/cgi-bin/coupon. You might have to explicitly set $base_dir at the top of $0 and make sure that discount.cfg is in that directory.". What does it mean? It means that for some reason, the script wasn't able to determine the directory that it is residing in. At this point, you will need to edit the file discount.pl and change the line #$base_dir = "/full/path/to/script"; Remove the "#" from the beginning of the line and enter the full path to the script between the quotes. You may need to ask your web administrator for the full path. Q. I get the error message "This program requires