Previous | Next Main Index:   Frames | No Frames
Document:   Frames | No Frames
 

Database Item Weight Shipping

 
Database Item Weight Shipping costs are based on item shipping weights stored in the shipping field in WebStore's product database, outlet.data.
 
%SHIPPING is a hash of arrays in WebStore's setup file, /Web_store/Databases/outlet.setup. listing all shipping variables.
 
%SHIPPING arrays in this file are configured for Database Item Weight Shipping.
Example:  $SHIPPING{1}[2]

 {1}  An array's KEY value. KEY values will be referenced by their
      numeric value in the explanations below (0, 1, 2, etc.).

 [2]  An array's element reference. Element numeric values will
      be spelled in the explanations below (zero, one, two, etc.)

      Specific arrays will be referenced as $SHIPPING{1}.

      A specific element within a specific array will be referenced
      as $SHIPPING{1}[2].
Arrays 1, 2, and 10 must exist in %SHIPPING. If any of these arrays are not present in %SHIPPING or the value of their KEY (1, 2, 10) is altered, shipping is disabled in WebStore.
 
Numeric array KEYS allow the Webstore script to sort the shipping methods in ascending order for printing to the client's web browser.
 
Arrays 0 and 3 - 9 are reserved and can not be used.
 
%SHIPPING = (

	# Determines type of shipping
	# Database Field, Handling, Free Shipping
	'1' => ['2:L',   '',   ''],


	# Domestic Shipping
	'2' => ['319',  '10','11','12','13'],


	# Universal Weight Ranges
	'3' => [             #  Order's Weight       Shipping Charged
	         '1: 6.95',  #   1 -  4 lbs/kilos     $6.95
	         '5: 9.95',  #   5 -  9 lbs/kilos     $9.95
	        '10:12.95',  #  10 - 14 lbs/kilos    $12.95
	        '15:15.95',  #  15 - 19 lbs/kilos    $15.95
	        '20:20.00',  #  20 - 24 lbs/kilos    $20.00
	        '25:30.00',  #  25 - 29 lbs/kilos    $30.00
	        '30:45.00',  #  30 lbs/kilos & up    $45.00
	       ],


	# Shipping Methods
	# 10  UPS Ground or Priority Mail:   $7.00 plus  .30/lb.
	# 11  2nd Day Air:                  $12.00 plus  .85/lb.
	# 12  Standard Next Day Air:        $20.00 plus 2.15/lb.
	# 13  Alaska & Hawaii:              $15.00 plus 2.00/lb.
	# 14  Canadian Orders:              $30.00 plus 2.05/lb.
	# 15  International Orders:         $40.00 plus 3.25/lb.

	#                                       Add       Price/lb
	'10' => ['UPS Ground or Priority Mail', '7.00',   '.30'],
	'11' => ['2nd Day Air',                 '12.00',  '.85'],
	'12' => ['Standard Next Day Air',       '20.00',  '2.15'],
	# State Specific Shipping Method
	'13' => ['Alaska & Hawaii',             '15.00',  '2.00',   '11:21'],
	# Country Specific Shipping Method
	'14' => ['Canadian Orders',             '30.00',  '2.05',   '132'],
	'15' => ['International Orders',        '40.00',  '3.25'],

); # DO NOT REMOVE - terminates %SHIPPING
 
Array 1 - $SHIPPING{1}
$SHIPPING{1} must exist in %SHIPPING. If $SHIPPING{1} is removed or the numeric value of it's KEY (1) is altered, shipping is disabled in WebStore.
 
$SHIPPING{1} consists of the following elements:

 KEY     zero    one     two
 '1' => ['2:L',  '3.50', '150.00'],
zero    Database Shipping Field
Element zero is the item weight field in the store's database, outlet.data. Element zero must be : (colon) delimited with one of the following values to print either a lbs., Kilogram, or Pound label:
   '2:K'  prints  'Kilogram'  LABEL
   '2:L'  prints  'lbs.'      LABEL
   '2:P'  prints  'Pound'     LABEL
   '2:'   prints  'lbs.'      LABEL
Element zero must contain a colon for Database Item Weight Shipping. If the colon is omitted from element zero, WebStore calculates Database Item Price Shipping.
Enter weights in decimal format in the database Shipping field:
  Ounces  to  Pounds

    1    =   .0625
    2    =   .0125
    3    =   .1875
    4    =   .25
    5    =   .3125
    6    =   .375
    7    =   .4375
    8    =   .5
    9    =   .5625
   10    =   .625
   11    =   .6875
   12    =   .75
   13    =   .8125
   14    =   .875
   15    =   .9375
Item weights may be whole or mixed numbers to four places (ten thousandths). Do not include commas in weight values. Weight values are fixed decimal numbers.
The total weight of an order is rounded up to the next full pound prior to calculating shipping costs. The exact weight, rounded to hundredths, is printed to the client's web browser.
 
one    Handling Charge
Element one is the labor charge for packaging an order for shipment.
Setting element one = '' disables the addition of a handling charge.
Do not include a dollar sign or commas in element one. Element one is a fixed decimal number.
 
two    Free Shipping
When the value of an order's subtotal is greater than the value listed in element two, no shipping or handling is charged for the order. The shipping drop down select element is not printed to the client's web browser.
Setting element two = '' disables free shipping checks, all orders pay shipping.
Do not include a dollar sign or commas in element two. Element two is a fixed decimal number.
 
 
%SHIPPING
 
Array 2 - $SHIPPING{2} - Domestic Shipping
$SHIPPING{2} must exist in %SHIPPING. If $SHIPPING{2} is removed or the numeric value of it's KEY (2) is altered, shipping is disabled in WebStore.
 
$SHIPPING{2} consists of the following elements:

 KEY     zero      one   two   three  four
 '2' => ['319',    '10', '11', '12',  '13'],
zero    Country Code
  Your 3 digit country code from %countries in outlet.state_country.setup.
 
one, two, three, etc.     Domestic Shipping Method KEYS
    Elements one, two, three, etc. is a listing off all domestic (your country's) shipping method KEYS in %SHIPPING.
List as many domestic shipping methods as you require.
 
Your 3 digit country code in element zero and the domestic shipping methods listed in elements one, two, three, etc. are used to determine if the client has chosen a shipping method which applies to their country of residence.
 
 
%SHIPPING
 
Array 3 - $SHIPPING{3} - Universal Weight Ranges
$SHIPPING{3} is optional. If you do not use Universal Weight Ranges, $SHIPPING{3} may be deleted.
 
$SHIPPING{3} example:

 '3' => [             #  Order's Weight       Shipping Charged
          '1: 6.95',  #   1 -  4 lbs/kilos     $6.95
          '5: 9.95',  #   5 -  9 lbs/kilos     $9.95
         '10:12.95',  #  10 - 14 lbs/kilos    $12.95
         '15:15.95',  #  15 - 19 lbs/kilos    $15.95
         '20:20.00',  #  20 - 24 lbs/kilos    $20.00
         '25:30.00',  #  25 - 29 lbs/kilos    $30.00
         '30:45.00',  #  30 lbs/kilos & up    $45.00
        ],
If the client-selected shipping method contains weight ranges in element one, the shipping method's range values are used in place of the universal ranges.
 
Each element of $SHIPPING{3} is colon delimited.
 
Order weight values are left of the colon in each element and the corresponding base shipping cost is right of the colon in each element.
 
The weight values must be listed in ascending order.
 
For example, if an order's weight equals 7.25 pounds, the order's base shipping cost is $9.95.
 
 
The base or universal shipping charge for an order are first calculated using the values listed in $SHIPPING{3}.
 
The values placed in this array should equal the values of your least expensive shipping method, usually a ground shipping method within the borders of your country.
 
After the base shipping value is determined, WebStore checks the contents of elements one and two of the client-selected shipping method for additional manipulations of the base shipping charges.
 
When a dollar value is present in element one of the client-selected shipping method and no value is present in element two, element one's value is added to the base shipping charge to determine total shipping charges.
 
When a value is present in element two of the client-selected shipping method, the base shipping charge is discarded. Shipping charges are calculated by multiplying the order's weight by the price/lb (or kilo) value found in element two. When a dollar value is present in element one, it is added to the product to determine total shipping costs.
 
If the charges for your shipping methods vary to the point that you can not use base or universal weight values, delete $SHIPPING{3}. Weight ranges or a dollar value may be placed in element one of each shipping method or a price/lb (or kilo) value must be placed in element two of each shipping method. If elements one and two of a shipping method are set to '' and $SHIPPING{3} does not exist, shipping costs will be set to 0.00.
 
 
%SHIPPING
 
Arrays 10 - XX $SHIPPING{10} - Shipping Methods
$SHIPPING{10} must exist in %SHIPPING. If $SHIPPING{10} is removed or the numeric value of it's KEY (10) is altered, shipping is disabled in WebStore.
 
$SHIPPING{10} is the first shipping method array.
 
The default shipping method used by WebStore is defined in $SHIPPING{10}.
 
$SHIPPING{10} remains the shipping method until the client selects an alternative shipping method.
 
Each shipping method array (10, 11, 12, etc.) consists of a maximum of four elements:

 KEY     zero                           one  two  three
'10' => ['UPS Ground or Priority Mail', '',  '',  ''],
zero    Shipping Label
The shipping label used in the shipping drop down select element on the order form HTML page, confirmation of order HTML page, and e-mail messages.
 
one    Add Value
When element one equals a dollar value, that value is added to the base shipping costs obtained using the universal weight range array, $SHIPPING{3}. When $SHIPPING{3} is not defined, element one's value becomes the total shipping cost for the shipping method.
Element one may contain a set of tilde delimited weight ranges:
'15' => ['International Orders',
         ' 1:22.95~
           5:25.95~
          10:28.95~
          15:31.95~
          20:36.00~
          25:46.00~
          30:61.00'',   '', ''],
Weight ranges present in a shipping method array take precedence over weight ranges in the universal weight range array, $SHIPPING{3}.
Do not include a dollar sign or commas in element one. Element one is a fixed decimal number.
 
two    Multiply Value - price per pound/kilo
The Multiply Value takes precedence over the shipping subtotal value and any value present in element one (Add Value) of the shipping method.
When a value exists in element two, the shipping subtotal is discarded. The order's weight is multiplied by the dollar value present in element two to obtain shipping costs. If a value is present in element one, element one's value is added to the shipping cost product, producing the order's shipping subtotal. If weight ranges are present in element one, they are not used.
Do not include a dollar sign or commas in element two. Element two is a fixed decimal number.
 
three    Country or State(s) Specific Shipping Method

'14' => ['Canadian Orders', '30.00', '2.05', '132'],
For country-specific shipping methods, list the country's 3 digit code from %countries in outlet.state_country.setup in element three. Only one country code may be listed in element three for a country-specific shipping method.

'13' => ['Alaska & Hawaii', '15.00', '2.00', '11:21'],
For state-specific shipping methods, list state 2 digit codes from %states in outlet.state_country.setup in element three. More than one state code may be listed in element three for a state-specific shipping method. Colon delimit multiple state codes.
 
 
%SHIPPING