6.6. price, description, accessories
[price code quantity* database* noformat*]
named attributes: [price code="code" quantity="N" base="database" noformat=1* optionX="value"]
Expands into the price of the product identified by code as found in the products database. If there is more than one products file defined, they will be searched in order unless constrained by the optional argument base. The optional argument quantity selects an entry from the quantity price list. To receive a raw number, with no currency formatting, use the option noformat=1.
If an named attribute corresponding to a product option is passed, and that option would cause a change in the price, the appropriate price will be displayed.
Demo example: The T-Shirt (product code 99-102), with a base price of $10.00, can vary in price depending on size and color. S, the small size, is 50 cents less; XL, the extra large size, is $1.00 more and the color RED is 0.75 extra. There are also quantity pricing breaks (see the demo pricing database. So the following will be true:
[price code=99-102 size=L] is $10.00 [price code=99-102 size=XL] is $11.00 [price code=99-102 color=RED size=XL] is $11.75 [price code=99-102 size=XL quantity=10] is $10.00 [price code=99-102 size=S] is $9.50
An illustration of this is on the simple flypage template when passed that item code.
[description code table*]
named attributes: [description code="code" base="database"]
Expands into the description of the product identified by code as found in the products database. If there is more than one products file defined, they will be searched in order unless constrained by the optional argument table.
[accessories code attribute*, type*, field*, database*, name*, outboard*]
named attributes: [accessories code="code" arg="attribute*, type*, field*, database*, name*, outboard*"]
Initiates special processing of item attributes based on entries in the product database. See Item Attributes for a complete description of the arguments.
When called with an attribute, the database is consulted and looks for a comma-separated list of attribute options. They take the form:
name=Label Text, name=Label Text*
The label text is optional. If none is given, the name will be used.
If an asterisk is the last character of the label text, the item is the default selection. If no default is specified, the first will be the default. An example:
[accessories TK112 color]
This will search the product database for a field named "color." If an entry "beige=Almond, gold=Harvest Gold, White*, green=Avocado" is found, a select box like this will be built:
<SELECT NAME="mv_order_color"> <OPTION VALUE="beige">Almond <OPTION VALUE="gold">Harvest Gold <OPTION SELECTED>White <OPTION VALUE="green">Avocado </SELECT>
In combination with the mv_order_item and mv_order_quantity variables, this can be used to allow entry of an attribute at time of order.