The Shopping Cart Config File Explained

Description

The shop.cfg file is the file which controls the configuration of the shopping cart program. It usually is placed in the same directory as the shop.pl program. Using shop.cfg you can change shipping rates, set the tax rate, setup admin email addresses, etc... To generate this file automatically please go here.

When filling out these variable please try to only change things between the double quotes or the single ticks. Please use a text editor like Wordpad to edit this file. Make sure you transfer this file in ASCII mode with your FTP program.

The shop.cfg Variables Explained:

Email receipt Information

  1. $admin - $admin1

    $admin and $admin1 control who to mail the administrative receipt to. Fill out $admin with your email address. If you have another email address you want the administrative receipts sent to then fill out $admin1.

    Example:
    $admin = 'you@yourdomain.com';
    $admin1 = '';
    


  2. $customer_subject - $admin_subject

    $customer_subject and $admin_subject control the subject of email receipts to you and and your customer.

    Example:
    $customer_subject = 'Order Confirmation';
    $admin_subject = 'Order Placed';
    


  3. $SEND_RECEIPT

    $SEND_RECEIPT controls whether an email receipt is sent to the customer. Possible values are 'Y' for yes and 'N' for no. The default is 'Y'.

    Example:
    $SEND_RECEIPT = 'Y';
    


  4. @REQUIRED

    @REQUIRED controls the email form fields that are required. Use a "Y" for required and a "N" or "" for not required.

    This is the order they are in:

    1. Email Address
    2. Telephone Number
    3. Name
    4. Street Address
    5. Street Address 2
    6. City
    7. State
    8. Zip Code
    9. Country
    10. Billing Street Address
    11. Billing Street Address 2
    12. Billing City
    13. Billing State
    14. Billing Zip Code
    15. Billing Country
    16. Comments
    17. Credit Card Type
    18. Credit Card Number
    19. Credit Card Expiration Date
    20. Gift Message
    21. Gift Wrapped
    22. Name on Credit Card
    23. Company Name

    Example:
    @REQUIRED = ("Y", "Y", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Y", "Y", "", "", "Y", "");
    

    This example would require email address, telephone number, credit card number, credit expiration date, and name on credit card.


Path Information



  1. $temp_location

    $temp_location is the location of a temporary directory. This is only required if running on Windows NT. Please do not include the ending slash in the path.

    Example:
    $temp_location = '/tmp';
    


  2. $shopping_root

    The shopping cart home directory. All the HTML files for the cart must be in this directory. This directory need not be accessible from the web. Please do not put the trailing '/' in the path.

    Example:
    $shopping_root = '/u/htdocs/test/shop';
    



  3. $product_file

    The filename of the delimited product list database. This file must be in the $shopping_root directory.

    Example:
    $product_file = 'product_list.txt';
    



  4. $mail_location

    This variable specifies where the mail program is located on your system usually '/usr/sbin/sendmail' or '/usr/lib/sendmail' in UNIX and 'c:/blat.exe' in Windows NT. Note the cart only works with sendmail or blat, you will need to custom modify it to work with other mail programs. Your web hosting company will know this value.

    Example:
    $mail_location = '/usr/lib/sendmail';
    



Tax Information



  1. $TAX

    Should the cart charge tax? Use '0' for No and '1' for Yes.

    Example:
    $TAX = '1';
    



  2. $tax_rate

    The tax rate to charge if the customer specifies $STATE as their state in the email form.

    Example:
    $tax_rate = '.058125';
    

    This example tells the cart to charge 5.8125% tax if the customer is from New Mexico. (The $STATE below)

  3. $STATE

    The 2 letter postal abbreviation for the state to charge tax in. Please use all caps.

    Example:
    $STATE = 'NM';
    



  4. $tax_calc

    Should the cart show the state checkbox in when it display the shopping list contents? Use 'Y' for Yes and 'N' for No. Basically this just allows the customer to see their correct total before they checkout.

    Example:
    $tax_calc = 'Y';
    



  5. $CALC_TAX_ON_SHIPPING

    This variable specifies whether to charge tax on shipping or not. If you set it to 'N', then your customers will just be charged tax on the subtotal. Use 'Y' for Yes and 'N' for No.

    Example:
    $CALC_TAX_ON_SHIPPING = "Y";
    



  6. %STATES

    This variable specifies additional states to charge tax in beyond the one specified in the varibale $STATE. The format is 'STATE', 'TAX_RATE', there is no limit on the number of states that can be specified. 'STATE' is the state to charge tax in caps. The 'TAX_RATE' is the tax rate for that state in the same format as $tax_rate.

    Example:
    %STATES = ('CA', '.09', 'NM', '.058125');
    

    So this example would charge 9% tax if the state specified in the email form is California. Likewise it would charge 5.8125% tax in New Mexico.


Miscellaneous Information



  1. $NT

    This variable tells the cart whether it is running on a Windows NT system or a UNIX system. Please set to '1' if running under Windows NT and '0' if running on UNIX.

    Example:
    $NT = '0';
    



  2. $CHECK_CC_NUM

    This tells the cart whether to use the credit card checking algorithm or not. The cart will check the credit card date and the credit card number from the email form if this is set to '1'. The credit card is checked using a mod 10 static algorithm. Basically this is a initial screening to make sure the credit card is good. Set to '1' to have this active, set to '0' to have it disabled.

    Example:
    $CHECK_CC_NUM = '0';
    



  3. $currency_symbol - $email_currency_symbol - $char_set

    $currency_symbol is the symbol used for currency in the shopping list when displayed on a web page. $email_currency_symbol is the symbol used for currency when the the email receipts are sent out. $char_set is the character set used when sending the email receipt out.

    Example:
    $currency_symbol = '$';
    $email_currency_symbol = '$';
    $char_set = 'us-ascii';
    

    This example has the settings best suited for the United States.

  4. $MY_URL

    The url of the shop.pl program without the http://yourdomain.com part. When you have this set you can use the variable MY_URL in your HTML in your shopping cart HTML pages. The MY_URL tag will be replaced by whatever you set $MY_URL to here. Usually you use this for all non-secure HREF tags. When you have a secure HREF you will just use the SECURE_URL tag.

    Example:
    $MY_URL = '/cgi-local/shop.pl/SID=PUT_SID_HERE';
    



  5. $SECURE_URL

    The secure url of the shop.pl program including the https:// part. This variable is the secure version of the MY_URL tag.

    Example:
    $SECURE_URL = 'https://www.yourdomain.com/cgi-local/shop.pl/SID=PUT_SID_HERE';
    



  6. $SECURE_IMG

    This is the secure URL to the shopping cart's images directory.

    Example:
    $SECURE_IMG = 'https://www.yourdomain.com/shop/cartpixs';
    



  7. $cart_page

    The name of the file that displays the shopping list to the customer. This variable is used by the search engine portion of the cart, if you don't set in the search engine will not work.

    Example:
    $cart_page = "cart.htm";
    



  8. $DISCOUNT

    This is the discount percentage. Use a '0' for no discount.

    Example:
    $DISCOUNT = '0.20';
    

    This example gives a 20% discount.

  9. $header_file

    This is the filename of the header file that is attached to the beginning of email receipts to the customer. This file must be in the in $shopping_root directory. If you leave this blank then no header will be sent.

    Example:
    $header_file = 'header.txt';
    



  10. $footer_file

    This is the filename of the footer file that is appended to the end of email receipts to the customer. This file must be in the in $shopping_root directory. If you leave this blank then no footer will be sent.

    Example:
    $footer_file = 'footer.txt';
    



  11. $DELIMITER

    This is the database delimiter. This is the special character used to seperate fields in the product database. Use '\t' for tab delimited and '\|' for pipe delimited. Pipe delimited is the default.

    Example:
    $DELIMITER = '\|';
    



  12. $SHOW_ORDER_NUM

    Show the order number (SID) in the email receipt? Use a '1' for Yes and a '0' for No. This is the same as the SID the cart uses to keep track of the customer.

    Example:
    $SHOW_ORDER_NUM = 0;
    



  13. $NO_BOOKMARKING

    Clients cannot bookmark pages while inside the cart web pages. Use '1' to enable and '0' to disable.
    $NO_BOOKMARKING = '0';
    



  14. $error_location

    The $error_location is the URL customers are redirected to when they jump into the shopping cart from a bookmark.

    Example:
    $error_location = 'http://www.irata.com/';
    



  15. $USE_DYNAMIC

    $USE_DYNAMIC allows you to use the dynamic page generation module that is built into the cart version 1.30 and later. Set it to '1' to turn it on and to '0' to turn it off.

    Example:
    $USE_DYNAMIC = '1';
    



  16. $PRODUCT_DISPLAY

    $PRODUCT_DISPLAY allows you to use the search format for PUT_PRODUCT_HERE token for the dynamic page generation module that is built into the cart. Set it to 'Y' to turn it on and to 'N' to turn it off.

    Example:
    $PRODUCT_DISPLAY = 'Y';
    



  17. $FONT_FACE

    Font face to use in cart generated HTML pages.

    Example:
    $FONT_FACE = 'Verdana, Arial, Helvetica, sans-serif';
    



  18. $FONT_SIZE

    Font size to use in cart generated HTML pages.

    Example:
    $FONT_SIZE = '2';
    



  19. $PAYMENT_FILE{'payment_type'}

    This specifies which page to send a certain payment type to. The page will be in the $shopping_root folder. Use the payment_type variable on the email form. Some payment types are check, money_order, wire_tranfer, paypal, cod, and credit_card. You can specify multiple $PAYMENT_FILE pages.

    Example:
    $PAYMENT_FILE{'paypal'} = 'paypal.html';
    $PAYMENT_FILE{'cod'} = 'cod.html';
    



  20. $USE_COOKIES

    Use cookies so customers can leave the cart or the website and have their order information still be there on their next visit.

    Example:
    $USE_COOKIES = 0;
    



  21. $COOKIE_PATH

    This variable specifies beginning of the path to the cart. (used for cookies) should be something like: /cgi-local/shop.pl

    Example:
    $COOKIE_PATH = '/cgi-local/shop.pl';
    



Shipping Information

    Explained in the "Shipping Charges" section of the documentation.


Authorize.Net Module Information

This only works only if you have the Authorize.net module installed.



  1. $USE_AUTHORIZE

    Set this variable to '1' to use the Authorize.Net module, '0' means don't use it.

    Example:
    $USE_AUTHORIZE = '1';
    



  2. $auth_host

    Authorize.Net servername (usually set to 'secure.authorize.net')

    Example:
    $auth_host = 'secure.authorize.net';
    



  3. $auth_cgi_path

    Path to the Authorize.net cgi program (should be /gateway/transact.dll)

    Example:
    $auth_cgi_path = '/gateway/transact.dll';
    



  4. $OS

    The Operating System the cart is running on. 'B' for BSD UNIX, 'O' for other, 'R' for Linux

    Example:
    $OS = 'O';
    



  5. $auth_login

    Your Authorize.Net login ID

    Example:
    $auth_login = 'test';
    



  6. $auth_password

    Your Authorize.Net password

    Example:
    $auth_password = '123456';
    



  7. $auth_type

    Type of credit card transactions to process ('AUTH_ONLY' = Authorization Only, 'AUTH_CAPTURE' = Normal Authorization)

    Example:
    $auth_type = 'AUTH_CAPTURE';
    



  8. $auth_refer

    Set the same value as the referring URL set in the Authorize.Net control panel.

    Example:
    $auth_refer = 'http://irata.com/cgi-local/shop.pl';
    



  9. $auth_receipt

    Should Authorize.Net send a email reciept to the customer? (This is in addition to the one the cart sends. ('Y' = Yes, 'N' = No)

    Example:
    $auth_receipt = 'Y'; 
    



Cybercash Express Module Information

This only works only if you have the Cybercash Express module installed.



  1. $USE_CYBERCASHX

    Set this variable to '1' to use Cybercash 3.2, '0' means don't use it.

    Example:
    
    $USE_CYBERCASHX = '1';
    



  2. $CYBERCASH_TYPE

    The type of credit card transactions to process. Use 'O' for authonly and 'C' for authcapture.

    Example:
    $CYBERCASH_TYPE = 'O';
    



  3. $CYBERCASH_CONFIG

    Cybercash 3.x configuration file location. Use the full path to this file. This file is usually called merchant_conf

    Example:
    $CYBERCASH_CONFIG = '/usr/local/test/merchant_conf';
    



Secure Module Information



  1. $USE_SECURE

    Set this variable to '1' to use the Secure module, '0' means don't use it.

    Example:
    $USE_SECURE = '0';
    



  2. $secure_file

    The location of the secure transaction file. This file must be writable by the cart program. Please include the full path.

    Example:
    $secure_file = '/u/htdocs1/testco/admin/secure.txt';
    



  3. $different_file

    To store each order in a different file set $different_file = '1'; in the shop.cfg file. The orders will be stored in secure/orders when this option is enabled. (make sure that directory exists.)

    Example:
    $different_file = '1';
    



UPS Shipping Information



  1. $USE_UPS

    To use UPS ground shipping charts as 1st shipping type (0 = No, 1 = Yes)

    Example:
    $USE_UPS = '1';
    



  2. $USE_UPS_2ND

    To use UPS 2nd Day Air shipping charts as 2nd shipping type (0 = No, 1 = Yes)

    Example:
    $USE_UPS_2ND = '1';
    



  3. $USE_UPS_1ST

    To use UPS next Day Air shipping charts as 3rd shipping type (0 = No, 1 = Yes)

    Example:
    $USE_UPS_1ST = '1';
    



  4. $zone_file

    Zone chart (downloaded from UPS's website) (should be in your shopping root directory)

    Example:
    $zone_file = 'zone.txt';
    



  5. $rate_file[0]

    UPS Ground Residential shipping chart (downloaded from UPS's website)

    Example:
    $rate_file[0] = 'gndres.csv';
    



  6. $rate_file[1]

    UPS Ground 2nd Day Air shipping chart (downloaded from UPS's website)

    Example:
    $rate_file[1] = '2da.csv';
    



  7. $rate_file[2]

    UPS Ground Next Day Air shipping chart (downloaded from UPS's website)

    Example:
    $rate_file[2] = '1da.csv';
    



  8. $handling

    Handling charge to be added to each item for UPS

    Example:
    $handling = '2.00';
    



  9. $weight_per_box

    Weight per box (use 99999, if you do not divide it like this)

    Example:
    $weight_per_box = '100';
    





MySQL Module Information



  1. $USE_MSYQL

    Set this variable to '1' to use the MySQL module, '0' means don't use it.

    Example:
    $USE_MYSQL = '1';
    



  2. $mysql_db_name

    The name of the MySQL database on your server.

  3. $mysql_username

    Your MySQL username needed to access the database above.

  4. $mysql_password

    Your MySQL password needed to access the database above.

  5. $store_name

    The name of your store. This will be used in the emails to the customer when they forget their password. This only works with the MySQL module.