For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

shipping

Returns the shipping cost, exclusive of sales tax, of all the items placed in the named cart so far.

Summary

  • [shipping mode]

Parameter Description Default
mode Whitespace, null or comma delimited list of modes upon which to calculate shipping cost. See below
modes Alias for mode. See below
name Alias for mode. See below
add Specify extra shipping data. None
cart Comma-separated list of cart names to calculate shipping cost for. main
carts Alias for cart. main
check_validity Return a true value if the shipping data is valid. No
convert Convert the amount according to the PriceDivide value for the current locale. Yes
country_var Specify a different "country" variable. country
default Reset the shipping mode to its default value. No
file Filename to read shipping from shipping.asc
format Defines a format for the return result (requires label). See below
handling Use [value mv_handling] rather than [value mv_shipping]. No
hide Suppress output. No
hide_error Suppress error messages. No
label Return an <option> widget unless overridden using format. No
noformat Suppress currency formatting from the amount. No
no_set If true then don't set the user's [value mv_shipmode] to the current mode. No
no_state Bypasses the state lookup for "widget=TYPE" and "possible=1". No
output_options Sets the default format to "%M=%D (%F)". No
possible Returns all possible modes for the selected country and state. No
reset_message Blanks the session's current shipping message. None
reset_modes Clears list of modes. No
resolve Returns the one shipping mode to set as a default, based upon the best information available. No
state_var Specify a different "state" variable. state
table Whitespace-delimited list of tables containing shipping data required for [perl] calculations. None
tables Alias for table. None
widget Returns a pre-configured widget for shipping mode selection. No

Examples

Tag expansion example

[shipping]
$0.00

Perl example

$Tag->shipping({
    mode => $mode,
});

or similarly with positional parameters:

$Tag->shipping($mode);

Description

Returns the shipping cost, exclusive of sales tax, of all the items placed in the named cart so far.  The calculation is performed using the specified shipping mode, which is usually set in the [value mv_shipmode].

This tag also provides options to build a selection widget (usually select or radio types) with embedded cost data.

Note

Note

The output of this tag can be overridden with the use of the [assign] tag.

Parameters

mode

Whitespace, null or comma delimited list of modes upon which to calculate shipping cost.

This parameter overrides the [value mv_shipmode] (or [value mv_handling] if handling is set true).

add

Specify extra shipping data.

cart

Comma-separated list of cart names to calculate shipping cost for.  Defaults to the current cart (usually "main").

check_validity

Return a true value if the shipping data is valid.

convert

Convert the amount according to the PriceDivide value for the current locale.

See the [currency] tag for a usage example.

country_var

Specify a [value] variable name to use to find the user-selected shipping country.  The default is "country.  I.e. [value country].

default

Reset the shipping mode to the default value set in [[[tags/value mv_shipmode].

file

Specify a filename to read shipping from.  The default is the usual shipping file (i.e. "shipping.asc").

format

If label is true then the shipping value is returned in the specified format.  For example:

[shipping
    mode="FLAT"
    label=1
    format="My Format Desc %D Price %F"
]

The default format is "<option value="%M"%S>%D (%F)</option>".

handling

Use [value mv_handling] rather than [value mv_shipping] as the first default for the mode parameter.

This attribute is only used if you do not specify a mode.

Note

Note

This is set by the [handling] tag, which calls the shipping tag internally.  You should use the [handling] tag rather than setting this directly.

hide

Suppress output.

hide_error

Suppress error messages.

label

Return an <option> widget unless overridden using format.

By default this cases a HTML <option> widget to be returned for each of the shipping mode(s), including the description and the cost.  You can override the widget with the format parameter.

Usage example: 

[shipping
    label=1
    mode=|[data table=country key='[default country US]' col=shipmodes]|
]
Note

Note

This parameter takes precedence over noformat.

noformat

If true then suppress currency formatting from the amount.

Note

Note

This parameter is only effective if the label parameter is not set true.

no_set

If true then don't set the user's [value mv_shipmode] to the current mode.

no_state

Bypasses the state lookup for "widget=TYPE" and "possible=1".

output_options

Sets the default format to "%M=%D (%F)".

possible

Returns all possible modes for the selected country and state, based upon the "country" and "state" tables.

This performs a query to find the "shipmodes" column of the state, based upon the users's [value state] and/or the "shipmodes" column of the country based on the user's [value country].

You can set the following additional parameters, although most will use the Interchange defaults:

Name Description Default
state_table State table for lookup state
country_table Country table for lookup country
state_modes_field Shipmodes column in state table shipmodes
country_modes_field Shipmodes column in country table shipmodes
state_var State variable in the user's session state
country_var Country variable in the user's session country
shipmode_var Shipmode variable in the user's session mv_shipmode

reset_message

Blanks the session's current shipping message.  ($Session->{ship_message}).

reset_modes

Clears list of modes in $Vend::Cfg->{Shipping_line}.

resolve

Returns the one shipping mode to set as a default, based upon the best information available.  Usually selects the first in the list based upon the country

state_var

Specify a [value] variable name to use to find the user-selected shipping state (county/area/etc.).

The default is "state.  I.e. [value state].

table

Whitespace-delimited list of tables containing shipping data required for perl calculations (i.e. in the "perl" column of your shipping table).  You must specify the tables to get past the Perl

Safe Link to an external page protection.  For example, you will get

Safe Link to an external page errors if you refer to a SQL table without specifying its name here.

widget

Returns a pre-configured widget for shipping mode selection.  This will select the modes using "possible=1", but will also do shipping calculations to see if they are valid.

If there is no weight, zip, country, or other required data then it will return "not enough information".

In other words, [shipping widget=select] might return the following:

<select name="mv_shipmode">
    <option value="upsg" selected="selected">UPS Ground ($4.20)</option>
    <option value="upsb">UPS 2nd Day Air ($8.76)</option>
</select>

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Friday 7 September 2007 at 6:31 PM (CDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us