2.69. shipping
Returns the cost of shipping the items in the cart via the shipping mode set with the mode parameter. See also the Shipping section of the Database documentation.
2.69.1. Summary
Parameters: mode
- mode
- Aliases: name, modes
- Whitespace, null or comma delimited list of modes for which to calculate shipping cost. See also mv_shipmode.
- Default: [value mv_handling] if handling=1 or [value mv_shipmode] or 'default'
- table
- Alias: tables
- Whitespace-delimited list of tables containing shipping data required for perl or query calculations (e.g., in the 'PERL' field of your shipping database -- see Shipping). You must specify the tables to get past the Perl 'Safe.pm' proctection. For example, you will get 'Safe' errors if you refer to an SQL table without specifying it here.
- Default: None
- cart
- Alias: carts
- Comma-delimited list of names of carts to calculate shipping cost for.
- Default: current cart
- convert
- Applies the conversion (if any) set with the PriceDivide catalog configuration directive.
- Default: True
- noformat
- Returns result as a number rather than a string formatted for the current locale's currency.
- Default: True
- handling
- Boolean-- use [value mv_handling] rather than [value mv_shipping] as first default for mode. Note that this attribute matters only if you do not specify the mode in the tag.
- Note that this is set by the [handling tag (which calls the shipping tag internally). You should probably use the handling tag rather than setting this directly.
- Default: False
- reset_modes
- Clears list of modes in $Vend::Cfg->{Shipping_line}
- Default: False
- add
- Adds the argument to add as data for a shipping.asc file (in $Vend::Cfg->{ScratchDir}/) and sets it.
- file
- Filename to read shipping from (default is usual shipping database, e.g., shipping.asc)
- label
- By default, returns HTML <OPTION ...> widget for shipping mode(s), including description and cost. You can override the widget with the format attribute. Note that label overrides noformat.
- Here is an example from the foundation checkout.html page:
[shipping label=1 mode=|[data table=country key='[default country US]' col=shipmodes]| ]
- format
- Format for results with label attribute.
- Default: '<OPTION VALUE="%M"%S>%D (%F)'
- For example,
-
[shipping mode="FLAT"
-
label=1
format="My Format Desc %D Price %F"]
- default
- Resets shipping mode to default of [value mv_shipmode]
- hide
- Suppresses output
- reset_message
- Boolean. Blanks the session's current shipping message (i.e., $Session->{ship_message}).
Must pass named parameter interpolate=1 to cause interpolation.
Invalidates cache: YES
Called Routine:
ASP-like Perl call:
$Tag->shipping( { mode => VALUE, } ) OR $Tag->shipping($mode, $ATTRHASH);
Attribute aliases
carts ==> cart modes ==> mode name ==> mode tables ==> table
2.69.2. Description
This tag calculates the shipping cost for items in the current cart via the specified shipping mode (usually set in the mv_shipmode variable). See the Shipping section of the Database documentation for detail.
2.69.2.1. Rounding
Note that the tag rounds the calculated shipping cost to a locale-specific number of fractional digits (e.g., to the nearest penny, or 2 digits after the decimal point in the USA).