Hostahoy Shopping Cart  
Installation

[ main menu ]

Installation is the first step to getting your store online and running. The entire process consists of untarring a single file and changing some variables in one file. 

To Install The Hostahoy Shopping Cart - Step by Step 

  1. upload cart.tar to your cgi-bin directory in binary mode
  2. in the cgi-bin directory, untar the file:

  3. tar -xvf cart.tar 
     
  4. Change the ownership of the cart directory and all the included sub directories - make sure you substitute "username" with your username on the server.

  5.  
    chown -R username cart 
     
  6. Verify the following scripts are executable on your server (chmod 755 is standard executable mode)
  7. admin.cgi 
    cart.cgi 
    setup.pl 
    colortest.cgi 
     
  8. Make sure the path to Perl is correct.  By default, scripts are setup using /usr/bin/perl.  If this is not correct for your system, you need to manually change the first line in the admin.cgi, cart.cgi, colortest.cgi,and setup.pl scripts to reflect the correct path.  Make sure you work with these files in ASCII mode and not binary when using FTP. 
  9. Edit the customize.pl file variables.  You will see the section to customize the variables: 
  10.  

    ################################################################# 
    # This is the only part of any script that needs to be customized 
    # For full info on setting up this file, please see 
    # http://www.hostahoy.com/cartmanual 
    # 
    $ordernumber = "1234567"; 

    Te ordernumber variable is REQUIRED for all scripts.  If you do not know your order number, contact support@hostahoy.com. If you are a current Hostahoy customer, use your Hostahoy username as the order number. 

    $script_location="http://yourdomain.com/cgi-bin/cart/cart.cgi"; 

    Script location is the full URL to the cart.cgi file (including the http://). Do not use https:// here if you have a secure server because running the entire script in a secure environment increases server load dramatically as well as decreases performance. 

    $domain = "yourdomain.com"; 

    The full domain name including any subdomain such as "www". The script can only be called by the domain stated here.  For example, if you have "www.domain.com" then calling the script by "http://domain.com" (without the www) will return an error. 

    $path_to_stores = "/home/yourusername/homes/httpd/html/stores"; 

    This is the directory that will hold the data for the Web store(s). A "path" is the location of a file according to the server.  There is no "http" involved. The $path_to_stores requires the absolute path from the root of the server.  There should be no trailing slash at the end. 

    $web_path = "/stores"; 

    The $web_path variable is not an absolute path, but rather the path from the html (or html) directory of the directory that will hold the data for the Web store(s). This begins with a "/" and should be the same as the last part of the $path_to_stores variable. 

    $date_path = '/usr/bin/date'; 
    $mailprog = '/usr/lib/sendmail'; 

    These variables are the absolute paths to the date and sendmail program on your server.  They should be correct as is but you can check with your system administrator if you are not sure. 

    NOTE: This file uses associative arrays.  These arrays begin with a "%".  The format is quite simple: %ARRAYNAME = ('key1','value2','key2','value2'); 
    Just make sure you surround each key and value with single quotes and end each line with a semicolon. 

    # Global Discounts (optional) 
    %QUANTITYDISCOUNTS = ('2','.10','5','.20','10','.30','15','.40'); 
    %NUDGE = ('cuistid1','15','cuistid2','10'); 

    This can be set if you wish to give customers discounts based on the number of orders they have already placed. In the "%QUANTITYDISCOUNTS" array you would enter the number of orders followed by the discount percentage for that quantity. In this example, a customer with 5-9 orders would get a discount of 20% (must be entered as .20). 

    The "%NUDGE" array accounts for orders that customers may have already placed that will not appear in the processed_orders.txt database text file. In this example, the customer with the ID "custid1" would start off with 15 orders, so even if no previous orders appear in the processed_orders.txt database they would still get the 40% discount. The customer with ID "custid2" would start off with a 30% discount and if they were to place 5 more orders, they would then receive the 40% discount automatically. 

    # Custom Discounts (optional) 
    %CUSTOMDISCOUNTS = ('Enter Your Reseller ID','resellers.txt'); 

    The custom discount feature searches the additonal customer information fields that you set up in your basic configuration for a description match.  From there, it compares the value of the field entered by the customer with the entries in the text file specified seaching for a match.  If it does find a match it uses the discount specified in the text file's second argument (say what?)... this is an advanced feature so it can be best demonstrated than explained: 

    If you have a list of resellers that get discounts based on their reseller ID (not customer ID), then this is what you would do: 

    1) In the basic administration area, setup an additional customer information field asking for the resellers ID like "Enter Your Reseller ID". 

    2) Create a text file consisting of the reseller IDs and the discounts they will get - one entry per line.  This must be in the following format: 

    texttomatch [tab] discount (in decimal format) [hard return] 

    Example: 

    jsmith                  .25 
    jdoe                     .20 
    bjones                 .30 

    3) Modify this customize.pl file and make sure the %CUSTOMDISCOUNT array is not commented.  The first part of the array 

    %CUSTOMDISCOUNTS = ('Enter Your Reseller ID','resellers.txt'); 

    is the exact text you have entered in the additional customer information. The second part of the array 

    %CUSTOMDISCOUNTS = ('Enter Your Reseller ID','resellers.txt'); 

    is the name of the file that the cart will use to search for the vaules entered by the customer.  The cart will look for an exact - case sensitive match of the variable on the left hand side of the tab then apply the discount on the right hand side of the tab.  So if a user entered "bjones" as their reseller ID in this example, they would receive a 30 percent (.30) discount on their entire order before shipping and taxes. 

    The text file MUST be placed in your admin directory for the store. 

    # Custom Submit Buttons 
    # Files MUST be named using all lower case like below: 
    # "go","get_order","order","order_check_out","do_not_order","edit_order", 
    # "edit","enter","continue","place_order","enter_secure_area" 

    # %CSB = ('STORE USERNAME','/stores/buttons/alt_buttons'); 
    $csb_ext = ".gif"; 

    You can replace all the Hostahoy Shopping Cart standard grey box submit buttons with your own icons.  To do this, uncomment the %CSB array and enter your username as the key and web path to the directory where the images are stored as the value. If you have multiple stores that are using their own set of images, simply create a key/value for each one in the %CSB array. Note that file names MUST match the names in the lines above exactly.  If the images are ".jpg" rather than ".gif", change the $csb_ext variable. 

    The Hostahoy Shopping Cart is now linked to exact areas of the manual for quick reference.  If you choose to duplicate the manual on your site, you can change this URL to link to your copy of the manual. 

    # Authorize.Net Required Variables  
    $authorizenet30 = "https://secure.authorize.net/gateway/transact.dll"; 
    $authorizenet30cr = "https://secure.authorize.net"; 
    %LOGIN = ('YOUR_USERNAME','AUTHORIZENET_USERNAME'); 

    This is where you enter the AuthorizeNet info if you are using their service to process your secure payments.  For full setup info on this, please see our page in this handbook. 

    # CardServices International Required Variables 
    $linkpointHTML = "https://secure.linkpt.net/cgi-bin/hlppay"; 
    $linkpointHTML = "https://secure.linkpt.net/admin/LOGIN/vlp"; 
    %STORENAME = ('cartusername','linkptusername'); 
     

    #################################################################

To Setup Your Store(s) 

1) Using a telnet session (shell account), telnet into your server and cd into your cart directory.  Then run  setup.pl.  This will create the store directory structure and files for you based on the variables you have entered in the customize.pl file.  

2) Make sure you password protect your admin and secure directories.  Ask your system administrator for help if  you are not sure how to do this.