4.49. options
Builds HTML widgets as defined in the options table for selecting options associated with a given product. This tag handles simple, matrix or modular options. See also the accessories tag.
Here is an illustrative example from the 'tools' sample data set of the foundation catalog:
=== [options code=os28005] --- <input type=hidden name=mv_item_option value="logo"> <SELECT NAME="mv_order_logo"> <OPTION VALUE="c">Construct Something <OPTION VALUE="y" SELECTED>Your Logo</SELECT><BR> <input type=hidden name=mv_item_option value="color"> <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BLK" > Black <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BEIGE" > Beige <INPUT TYPE="radio" NAME="mv_order_color" VALUE="WHITE" > White<BR> <input type=hidden name=mv_item_option value="bristle"> <SELECT NAME="mv_order_bristle"> <OPTION VALUE="synthetic">Synthetic <OPTION VALUE="camel">Camel Hair</SELECT> ===
4.49.1. Summary
[options code]
Parameters | Description | Default |
bold |
Boldfaces the labels if the 'label' option is set.
|
DEFAULT_VALUE |
code |
Product key (usually sku).
|
DEFAULT_VALUE |
joiner |
The joiner for the widgets.
|
DEFAULT_VALUE |
label |
Shows labels for the options with the widgets.
The following example (using another item from the 'tools' data) illustrates the price and label attributes: === [options code=os28011 label=1 price=1] --- Handle<BR> <input type=hidden name=mv_item_option value="handle"> <SELECT NAME="mv_order_handle"> <OPTION VALUE="W">Wood handle <OPTION VALUE="E">Ebony handle ($20.00)</SELECT><BR> Blade material<BR> <input type=hidden name=mv_item_option value="blade"> <SELECT NAME="mv_order_blade"> <OPTION VALUE="P">Plastic blade ($-1.22) <OPTION VALUE="S" SELECTED>Steel blade <OPTION VALUE="T">Titanium blade ($100.00)</SELECT> === (again, the output has been reformatted to fit the page).
|
DEFAULT_VALUE |
price |
Boolean. If set and the options have prices, the HTML widget(s) will show the prices. This is like the price attribute of the accessories tag.
Technical note-- If your options table has different mappings, you can control this with $::Variable->{MV_OPTION_TABLE_MAP} |
False |
table |
Table to use for option attributes.
|
DEFAULT_VALUE |
td |
Results as table rows. For example, compare the following example from the 'tools' sample data set with the earlier example:
=== [options code=os28005 td=1] --- <td><input type=hidden name=mv_item_option value="logo"> <SELECT NAME="mv_order_logo"> <OPTION VALUE="c">Construct Something <OPTION VALUE="y" SELECTED>Your Logo</SELECT></td> <td><input type=hidden name=mv_item_option value="color"> <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BLK" > Black <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BEIGE" > Beige <INPUT TYPE="radio" NAME="mv_order_color" VALUE="WHITE" > White</td> <td><input type=hidden name=mv_item_option value="bristle"> <SELECT NAME="mv_order_bristle"> <OPTION VALUE="synthetic">Synthetic <OPTION VALUE="camel">Camel Hair</SELECT></td> === (Note that the output was reformatted to fit this page) |
DEFAULT_VALUE |
Attributes | Default |
interpolate (reparse) | No |
Other_Characteristics | |
Invalidates cache | no |
Container tag | No |
Has Subtags | No |
Nests | Yes |
Tag expansion example:
[options code] --- TODO: (tag result)
ASP-like Perl call:
$Tag->options( { code => VALUE_code }, $body );
or similarly with positional parameters,
$Tag->options(code, $attribute_hash_reference, $body);
4.49.2. Description
NO DESCRIPTION SECTION
4.49.2.1. bold
Boldfaces the labels if the 'label' option is set.
- Default: False
4.49.2.2. code
Product key (usually sku).
- No default
4.49.2.3. joiner
The joiner for the widgets.
- Default: <BR>
4.49.2.4. label
Shows labels for the options with the widgets.
The following example (using another item from the 'tools' data) illustrates the price and label attributes:
=== [options code=os28011 label=1 price=1] --- Handle<BR> <input type=hidden name=mv_item_option value="handle"> <SELECT NAME="mv_order_handle"> <OPTION VALUE="W">Wood handle <OPTION VALUE="E">Ebony handle ($20.00)</SELECT><BR> Blade material<BR> <input type=hidden name=mv_item_option value="blade"> <SELECT NAME="mv_order_blade"> <OPTION VALUE="P">Plastic blade ($-1.22) <OPTION VALUE="S" SELECTED>Steel blade <OPTION VALUE="T">Titanium blade ($100.00)</SELECT> ===
(again, the output has been reformatted to fit the page).
- Default: False
4.49.2.5. price
Boolean. If set and the options have prices, the HTML widget(s) will show the prices. This is like the price attribute of the accessories tag.
-
Note that the price_data setting comes from the 'price' column of the options table.
- Default: False
Technical note-- If your options table has different mappings, you can control this with $::Variable->{MV_OPTION_TABLE_MAP}
4.49.2.6. table
Table to use for option attributes.
- Default: 'options'
4.49.2.7. td
Results as table rows. For example, compare the following example from the 'tools' sample data set with the earlier example:
=== [options code=os28005 td=1] --- <td><input type=hidden name=mv_item_option value="logo"> <SELECT NAME="mv_order_logo"> <OPTION VALUE="c">Construct Something <OPTION VALUE="y" SELECTED>Your Logo</SELECT></td> <td><input type=hidden name=mv_item_option value="color"> <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BLK" > Black <INPUT TYPE="radio" NAME="mv_order_color" VALUE="BEIGE" > Beige <INPUT TYPE="radio" NAME="mv_order_color" VALUE="WHITE" > White</td> <td><input type=hidden name=mv_item_option value="bristle"> <SELECT NAME="mv_order_bristle"> <OPTION VALUE="synthetic">Synthetic <OPTION VALUE="camel">Camel Hair</SELECT></td> ===
(Note that the output was reformatted to fit this page)