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

You are not logged in

Powered by Interchange version 5.7.0

total-cost

Returns the total cost of all the items in the current shopping cart, including sales tax (if any).

Summary

  • [total-cost name noformat]

Parameter Description Default
name Name of the cart to operate on. main
cart Alias for name. main
convert Convert the amount according to the PriceDivide value for the current locale. No
display Display the currency identifier as a symbol, as plain text or not at all. symbol
locale Override the current locale for the currency format. None
noformat suppress currency formatting. No

Examples

Tag expansion example

In a cart that happens to currently total $12.00:

[total-cost]

would output $12.00, and:

[total-cost name="main" noformat=1]

would output 12.00 (note the absence of the currency symbol).

Perl example

$Tag->total_cost({
    name => 'main',
    noformat => 0,
});

or similarly with positional parameters:

$Tag->total_cost($name, $noformat, $attribute_hash_reference);

Description

Returns the total cost of all the items in the current shopping cart, including sales tax (if any).

Parameters

name

The name of the shopping cart you want the total cost from.  The default shopping cart name in Interchange is "main", but you can have as many as you need for your application.

convert

If true then convert the amount according to the PriceDivide value for the current locale.

See the [currency] tag for a usage example.

display

The currency identifier will usually be displayed as a symbol (i.e. "£" or "$" etc.).  If this parameter is set to "text" then the currency identifier will be displayed as plain text (i.e. "GBP" or "USD" etc.), depending upon the locale settings.  If this parameter is set to "none" then the currency identifier will not be displayed at all.  See the [currency] tag.

locale

This parameter allows you to override the current locale that would be used to format the result and provide the exchange rate.  See the [currency] tag.

Note

Note

Setting this parameter causes the convert parameter to also be set, unless you specify "convert=0".

noformat

If true then suppress currency formatting from the value returned from this tag.  See the [currency] tag.

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Thursday 16 November 2006 at 10:41 AM (CST)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us