Setting up the Shipping Charges


The Shopping Cart Configuration File Generator can set the shipping charges up for you automatically in the shop.cfg file, if you wish. If you use this option, you can skip this part of the documentation.


The Shopping Cart program can accommodate up to eight types of shipping charges. You must set the names of these eight shipping charges as your first step.


# labels for shipping types

$shipping_label{1} = 'UPS Ground';
$shipping_label{2} = '';
$shipping_label{3} = '';
$shipping_label{4} = '';
$shipping_label{5} = '';
$shipping_label{6} = '';
$shipping_label{7} = '';
$shipping_label{8} = '';


If you only want 2 shipping types:

$shipping_label{1} = "UPS Ground";
$shipping_label{2} = "UPS Red";
$shipping_label{3} = "";
$shipping_label{4} = "";
$shipping_label{5} = "";
$shipping_label{6} = "";
$shipping_label{7} = "";
$shipping_label{8} = "";

These appear on the email receipts and also these are the choices the customer sees on the order page. The first shipping label is the default shipping type.


You can set a handling charge to charge per order in the shop.cfg file.


$handling_per_order = '20.00';


This example sets a handling charge of $20.00 per order.




Now you need to set the type of shipping algorithm you wish to use.

The Shopping Cart program support four shipping algorithms:

  1. Shipping charged by item
  2. Shipping charged by cost
  3. Shipping charged by weight
  4. Shipping charged by percentage of subtotal
  5. Shipping charged by UPS ground shipping tables


  1. Shipping charged by number of items

    Your first step in setting up shipping by number of items is to set this variable in the shop.cfg file:

    $SHIPPING_ALGORITHM = 0;

    The shipping charges are calculated using a simple base charge plus an additional charge for each item ordered. The shipping section is located in the shop.cfg file as shown below:

    The actual shipping 'base' and 'rate' charges are specified at the end of the shop.cfg file as shown below:

    # shipping base's and rates
    
    $shipping_base{1} = '2.95';
    $shipping_rate{1} = '1.00';
    $shipping_base{2} = '';
    $shipping_rate{2} = '';
    $shipping_base{3} = '';
    $shipping_rate{3} = '';
    $shipping_base{4} = '';
    $shipping_rate{4} = '';
    $shipping_base{5} = '';
    $shipping_rate{5} = '';
    $shipping_base{6} = '';
    $shipping_rate{6} = '';
    $shipping_base{7} = '';
    $shipping_rate{7} = '';
    $shipping_base{8} = '';
    $shipping_rate{8} = '';
    

    The $shipping_base is the charge the cart charges once for every order. The $shipping_rate is the amount the cart charges per item ordered. The number in the {}'s will be associated the $shipping_label that shares the same number.

    Examples:

    Single charge of $20.00 for total order:

    $shipping_base{1} = '20.00'; 
    $shipping_rate{1} = '0.00';

    Flat rate of $6.00 per item:

    $shipping_base{2} = '0.00'; 
    $shipping_rate{2} = '6.00';

    $8.00 base charge plus an additional $3.50 per item:

    $shipping_base{3} = '8.00'; 
    $shipping_rate{3} = '3.50';

    $11.00 for first item plus $3.00 for each additional item:

    $shipping_base{4} = '11.00'; 
    $shipping_rate{4} = '3.00';





  2. Shipping charged by cost of items

    Your first step in setting up shipping by cost is to set this variable in the shop.cfg file:

    $SHIPPING_ALGORITHM = 1;

    Then you will use the $shipping_base and $shipping_rate variables similar to the first shipping type above. The shipping_base is the cutoff point in price where the cart changes the shipping cost. The shipping_rate is the price that is charged in shipping at a certain $shipping_base. You must always have the last $shipping_base set to 9999999.00. This is so no matter what amount above the $shipping_base before it, the cart will charge the last $shipping_rate. The shipping descriptions are set as per the first shipping algorithm by number of items.

    For the eight shipping types use these variables:

    1. $shipping_base, $shipping_rate
    2. $shipping_base2, $shipping_rate2
    3. $shipping_base3, $shipping_rate3
    4. $shipping_base4, $shipping_rate4
    5. $shipping_base5, $shipping_rate5
    6. $shipping_base6, $shipping_rate6
    7. $shipping_base7, $shipping_rate7
    8. $shipping_base8, $shipping_rate8

    Example:

    $shipping_base{1} = "10.00";    
    $shipping_rate{1} = "5.75";
    $shipping_base{2} = "20.00";
    $shipping_rate{2} = "7.95";
    $shipping_base{3} = "30.00";
    $shipping_rate{3} = "8.95";
    $shipping_base{4} = "45.00";
    $shipping_rate{4} = "9.95";
    $shipping_base{5} = "70.00";
    $shipping_rate{5} = "10.95";
    $shipping_base{6} = "999999999.00";
    $shipping_rate{6} = "11.95";
    $shipping_base2{1} = "10.00";    
    $shipping_rate2{1} = "10.75";
    $shipping_base2{2} = "999999999.00";
    $shipping_rate2{2} = "20.95";
    

    This example charges like this for the first shipping type:

    If the order's subtotal is below $10.00 they are charged $5.75 in shipping.
    If the order's subtotal is below $20.00 but above $10.00 they are charged $7.95 in shipping.
    If the order's subtotal is below $30.00 but above $20.00 they are charged $8.95 in shipping.
    If the order's subtotal is below $45.00 but above $30.00 they are charged $9.95 in shipping.
    If the order's subtotal is below $70.00 but above $45.00 they are charged $10.95 in shipping.
    If the order's subtotal is above $70.00 they are charged $11.95 in shipping.

    This example charges like this for the second shipping type:

    If the order's subtotal is below $10.00 they are charged $10.75 in shipping.
    If the order's subtotal is above $20.00 they are charged $20.95 in shipping.





  3. Shipping charged by weight

    First off, you must have version 1.21 or higher of the shopping cart.

    Your second step in setting up shipping by weight is to set this variable in the shop.cfg file:

    $SHIPPING_ALGORITHM = 2;

    Then you will use the $shipping_base and $shipping_rate variables similar to the first shipping type above. The shipping_base is the cutoff point in weight where the cart changes the shipping cost. The shipping_rate is the price that is charged in shipping at a certain $shipping_base. You must always have the last $shipping_base set to 9999999.00. This is very similar to the shipping by price algorithm. This is so no matter what amount above the $shipping_base before it, the cart will charge the last $shipping_rate.

    The weight for each item will be retrieved from the weight field of the product database file.

    For the eight shipping types use these variables:

    1. $shipping_base, $shipping_rate
    2. $shipping_base2, $shipping_rate2
    3. $shipping_base3, $shipping_rate3
    4. $shipping_base4, $shipping_rate4
    5. $shipping_base5, $shipping_rate5
    6. $shipping_base6, $shipping_rate6
    7. $shipping_base7, $shipping_rate7
    8. $shipping_base8, $shipping_rate8

    Example:

    $shipping_base{1} = "10";    
    $shipping_rate{1} = "5.75";
    $shipping_base{2} = "20";
    $shipping_rate{2} = "7.95";
    $shipping_base{3} = "30";
    $shipping_rate{3} = "8.95";
    $shipping_base{4} = "45";
    $shipping_rate{4} = "9.95";
    $shipping_base{5} = "70";
    $shipping_rate{5} = "10.95";
    $shipping_base{6} = "999999999.00";
    $shipping_rate{6} = "11.95";
    $shipping_base2{1} = "10";    
    $shipping_rate2{1} = "10.75";
    $shipping_base2{2} = "999999999.00";
    $shipping_rate2{2} = "20.95";
    

    This example charges like this for the first shipping type:

    If the order's subtotal is below 10 pounds they are charged $5.75 in shipping.
    If the order's subtotal is below 20 pounds but above 10 pounds they are charged $7.95 in shipping.
    If the order's subtotal is below 30 pounds but above 20 pounds they are charged $7.95 in shipping.
    If the order's subtotal is below 45 pounds but above 30 pounds they are charged $9.95 in shipping.
    If the order's subtotal is below 70 pounds but above 45 pounds they are charged $10.95 in shipping.
    If the order's subtotal is above 70 pounds they are charged $11.95 in shipping.

    This example charges like this for the second shipping type:

    If the order's subtotal is below 10 pounds they are charged $10.75 in shipping.
    If the order's subtotal is above 20 pounds they are charged $20.95 in shipping.





  4. Shipping charged by percentage

    First off, you must have version 1.33 or higher of the shopping cart.

    Your second step in setting up shipping by weight is to set this variable in the shop.cfg file:

    $SHIPPING_ALGORITHM = 3;

    This is shipping by percentage of the subtotal. $shipping_rate{$shipping_type} is the percentage to charge for each shipping type. $shipping_base does nothing when you are using this algorithm. $shipping_minimum is the minimum shipping to charge. Example:

    $shipping_rate{1} = ".06";
    $shipping_rate{2} = ".08";
    $shipping_base{3} = ".10";
    
    $shipping_minimum = '5.00';
    
    

    This example charges 6% of the subtotal for shipping for shipping type #1, 8% for the 2nd shipping type, and 10% for the 3rd shipping type. A minimum of $5.00 will be charged for shipping.





  5. How to use UPS Shipping Tables with the Cart

    First off, you must have version 1.50 or higher of the shopping cart. Then go to UPS's website to retrieve the UPS zone file for your zip code and the UPS ground shipping rates. Use the Download Zone Charts form on the UPS site to Download your zone file. Use the RATE CHARTS FOR SHIPPING WITHIN THE U.S->UPS Ground Rates to retrieve the shipping rate file(s). They must be in comma delimited format. Make sure you use the download option to retreive the comma delimited files from UPS's website.

    Example zone file.

    Example ground shipping rates file.

    You need to put these in your shopping root directory. The are typically named zone.txt, gndres.csv, 2da.csv, 1da.csv. Please see the Shop Config File Explained section to see how to setup UPS Ground shipping tables alogrithm in the shop.cfg file. You should have a text box come up on your shop.html page asking for the customer's zip code. When this zip code is entered and recalculate pressed, the correct UPS shipping charge will be shown. You can also specify a handling charge per package and the maximum weight a box will take in the shop.cfg file.

    Note: The UPS Ground shipping tables work with the first shipping type. The UPS 2nd Day Air shipping tables work with the second shipping type. The UPS 1st Day Air shipping tables work with the third shipping type. The rest of the shipping types will use whatever shipping algorithm you have chosen.