Index  Up  <<  >>  


Tags for summarizing shopping basket/cart

The following elements are used to access common items which need to be displayed on baskets and checkout pages.

* marks an optional parameter

[item-list cart*]
named attributes: [item-list name="cart"]

Places an iterative list of the items in the specified shopping cart, the main cart by default. See Item Lists for a description.

[/item-list]
Terminates the [item-list] tag.

[value field flag*]
Expands into the current value of the customer input field named by field. If flag is present, single and double quotes will be escaped with a backslash; this allows reliable SQL inserts. See the section on input fields for more information.

[nitems cart*]
Expands into the total number of items ordered so far. Takes an optional cart name as a parameter.

[subtotal]
Expands into the subtotal cost, exclusive of sales tax, of all the items ordered so far.

[salestax cart*]
Expands into the sales tax on the subtotal of all the items ordered so far. If there is no key field to derive the proper percentage, such as state or zip code, it is set to 0. See Sales Tax for more information.

[shipping-description mode*]
named attributes: [shipping-description name="mode"]

The text description of mode -- the default is the shipping mode currently selected.

[shipping mode*]
named attributes: [shipping name="mode"]

The shipping cost of the items in the basket via mode -- the default mode is the shipping mode currently selected in the mv_shipmode variable. See SHIPPING.

[total-cost cart*]
Expands into the total cost of all the items in the current shopping cart, including sales tax (if any).

[calc]
Starts a region where the arguments are calculated according to normal arithmetic symbols. For instance:

    [calc] 2 + 2 [/calc]

will display:

    4

[/calc]
Terminates the calculated region.

The [calc] tag is really the same as the [perl] tag, except that it doesn't accept arguments, is more efficient to parse, and is interpolated at a higher precedence.

TIP: The [calc] tag will remember variable values inside one page, so you can do the equivalent of a memory store and memory recall for a loop.

[currency convert*]
named attributes: [currency convert=1*]

When passed a value of a single number, formats it according to the currency specification. For instance:

    [currency]4[/currency]

will display:

    4.00

Uses the Locale and PriceCommas settings as appropriate, and can contain a [calc] region. If the optional ``convert'' parameter is set, it will convert according to PriceDivide> for the current locale. If Locale is set to fr_FR, and PriceDivide for fr_FR is 0.167, the following sequence

    [currency convert=1] [calc] 500.00 + 1000.00 [/calc] [/currency]

will cause the number 8.982,04 to be displayed.

[/currency]
Terminates the currency region.

[cart name]
named attributes: [cart name="name"]

Sets the name of the current shopping cart for display of shipping, price, total, subtotal, and nitems tags. If you wish to use a different price for the cart, all of the above except [shipping] will reflect the normal price field. You must emulate those operations with embedded Perl or the [item-list], [calc], and [currency] tags, or use the PriceAdjustment feature to set it.

[row nn]
named attributes: [row width="nn"]

Formats text in tables. Intended for use in emailed reports or < PRE>< /PRE> HTML areas. The parameter nn gives the number of columns to use. Inside the row tag, [col param=value ...] tags may be used.

[/row]
Terminates a [row nn] element.

[col width=nn wrap=yes|no gutter=n align=left|right|input spacing=n]
Sets up a column for use in a [row]. This parameter can only be contained inside a [row nn] [/row] tag pair. Any number of columns (that fit within the size of the row) can be defined.

The parameters are:

    width=nn        The column width, I<including the gutter>. Must be
                    supplied, there is no default. A shorthand method
                    is to just supply the number as the I<first> parameter,
                    as in [col 20].
        
    gutter=n        The number of spaces used to separate the column (on
                    the right-hand side) from the next. Default is 2.
        
    spacing=n       The line spacing used for wrapped text. Default is 1,
                    or single-spaced.
        
    wrap=(yes|no)   Determines whether text that is greater in length than
                    the column width will be wrapped to the next line. Default
                    is I<yes>.
        
    align=(L|R|I)   Determines whether text is aligned to the left (the default),
                    the right, or in a way that might display an HTML text
                    input field correctly.

[/col]
Terminates the column field.


Index  Up  <<  >>