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. It always needs to be present if
CustomShipping is to be used.
- code
-
The unique identifier for that shipping method and criteria range.
- description
-
Text to describe the method (can be accessed on a page with the
[shipping-description]
element).
- criteria
-
Whether shipping is based on weight, quantity, price, etc. Valid MiniVend
tags can be placed in the field to do a dynamic lookup -- if a number is
returned, that is used as the accumulated criteria -- that is, the total of weight, quantity, or price as applied to all items
in the shopping cart.
The criteria field varies according to whether it is the first field in the
shipping file exactly matching the mode identifier. In that case, it is
called the main criterion. If it is in subsidiary shipping lines matching the mode (with optional
appended digits) then it is called a
qualifying criterion. The difference is that the main criterion returns the basis for the
calculation (i.e. weight or quantity) while the qualifying criterion
determines whether the individual line may match the conditions.
The return must be one of:
- o quantity
-
quantity -- The literal value quantity as the main criterion will simply count the number of items in the shopping
cart and return it as the accumulated criteria.
- o <field name>
-
A valid product database field (column) name as main
criterion will cause the number of items in the shopping cart to be
multiplied by the
value of the field for each item to obtain the accumulated criteria.
- o n.nn
-
where n.nn is any number. It will be directly used as the
accumulated criteria. This can be effectively returned from a Perl subroutine or MiniVend
[calc][item-list] ... [/item-list][/calc]
to create custom shipping routines.
IMPORTANT NOTE: The above only applies to the first field that matches the shipping mode exactly. Following criteria fields contain qualifier matching strings.
- minimum
-
The low bound of quantity/weight/criteria this entry applies to.
- maximum
-
The high bound of quantity/weight/criteria this entry applies to. The first
found entry is used in case of ties.
- cost
-
The total cost, determined by formula if it begins with f, by multiplier if it begins with x, by UPS-style lookup if it begins with u or
[A-Z]
, by named subroutine if it begins with an s, by a MiniVend chained cost calculation if m or i, and a straight cost otherwise. If it begins with an e, a zero cost is returned with the following string as the error message.