The shipping cost database (located in ProductDir/shipping.asc) is a tab-separated ASCII file with six fields -- code, text description, criteria (quantity or weight, for example), minimum number, maximum number, and cost. None of the fields are case-sensitive.
If you want to define the shipping database in your catalog configuration file, set the Variable MV_SHIPPING to what would be its contents.
To set the file to be something other than shipping.asc in the products
directory, set the Special
directive:
Special shipping.asc /home/user/somewhere/shipping_defs
There are two styles of setting, which can be mixed in the same file. The first is line-based, and expects 6 or more TAB-separated fields. They would look like:
default No shipping weight 0 99999999 0
upsg UPS Ground weight 0 0 e Nothing to ship! upsg UPS Ground weight 0 150 u Ground [default zip 98366] 3.00 upsg UPS Ground weight 150 999999 e @@TOTAL@@ lbs too heavy for UPS
The second is a freeform method, with a mode: Description text
introducing the mode line, and the special encoding called out by indented
parameters. The below is identical to the above:
upsg: UPS Ground criteria weight min 0 max 0 cost e Nothing to ship! min 0 max 150 cost u table 2ndDayAir geo zip default_geo 98366 adder 3
min 150 max 999999 cost e @@TOTAL@@ lbs too heavy for UPS
The second format has several advantages. You can span multiple lines with the <<HERE document format, like so:
upsg: UPS Ground criteria <<EOF [perl] return 'weight' if $Values->{country} eq 'US'; return 'weight' if ! $Values->{country}; # Return blank, don't want UPS return ''; [/perl] EOF The defineable fields are, in order for the tab-separated format:
[shipping-description]
element).
See Criteria Determination
below.
f Formula (MML tags OK, evaluated as Perl) x Multiplied by a number [uA-Z] UPS-style lookup m MiniVend chained cost lookup (all items summed together) i MiniVend chained cost lookup (items summed individually)
next
field supplies an alternative shipping mode to substitute if the cost of
the current one is zero.
cost
option with ``f '' as the prelim to supply Perl code to determine cost.