EKM Tag: [ekm:productoptions]
This tag outputs all product options and variants for the current product being viewed.
This tag can only be used on the product page. This tag MUST be placed within the product start and end tags.
- Tag Information
- Nesting This Tag
- Examples
[ekm:productoptions][/ekm:productoptions]
Colour |
Gift Message |
Text Area |
If you would prefer to customise how your product options/variants appear you can use this full use tag. This allows you to specify how your options will be ordered and the styling around the options. You are also able to order the items within a dropdown by value and name.
For the example below view the examples tab for the CSS styling.
[ekm:productoptions]
font_formatting='no';
remove_formatting='yes';
orderby='name ASC';
orderbyitems='name ASC, amount DESC';
template_start='<div id="product-options">';
textfield_content='<div class="option-row textfield-option cf" id="textfield-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
textarea_content='<div class="option-row textarea-option cf" id="textarea-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
dropdown_content='<div class="option-row select-dropdown cf" id="select-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
template_end='</div>';
[/ekm:productoptions]
font_formatting='no'';
Specify whether or not you want the product option labels to have font formatting.
remove_formatting='no'';
Specify whether you want to remove all default layout styling from around the options. This removes all tables and label tags.
orderby='name ASC';
Specify the order you would like your product options and variants to be output. You can order by the option's name or by the order they were added in the backend of your EKM shop.
orderbyitems='amount ASC';
Specify the order you would like items within a dropdown menu to appear. You can order by when they were added, name or amount (price).
This works on options only. The order of variant items are unaffected.
template_start='<div id="product-options">';
Specify any HTML or Text you want to be outputted when the product options begin to output. This will display once and will go before the option items are output. This works in the same way html_before
and output_start
do in other tags.
textfield_content='<div class="option-row textfield-option cf" id="textfield-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
Specify the HTML or Text you want to output when a textfield option is displayed.
This attribute has some attribute tags to display the fields and labels.
textfield_content_formatting='no';
Specifies whether or not to remove extra HTML formatting around the textfield element.
This attribute has some attribute tags to display the fields and labels.
textarea_content='<div class="option-row textarea-option cf" id="textarea-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
Specify the HTML or Text you want to output when a text area option is displayed.
This attribute has some attribute tags to display the fields and labels.
dropdown_content='<div class="option-row select-option cf" id="select-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
Specify the HTML or Text you want to output when a dropdown option is displayed.
This attribute has some attribute tags to display the fields and labels.
template_end='</div>';
Specify any HTML or Text you want to be outputted when all product options have been output. This will display once and will go after the option items are output. This works in the same way html_after
and output_end
do in other tags.
change_callback='doChange';
Define a JavaScript function in global scope to be called when the product option has changed.
The EKM system allows for some tags to be nested within other tags.
When nesting this tag you need to prepend the tag with nested_
and replace all '
single quotes with double quotes "
[ekm:if]
iftype='EQUALS';
ifvalue='1';
ifvalue2='1';
ifthen='
[ekm:nested_productoptions]
font_formatting="no";
remove_formatting="yes";
orderby="name ASC";
orderbyitems="name ASC, amount DESC";
template_start="<div id="product-options">";
textfield_content="<div class="option-row textfield-option cf" id="textfield-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>";
textarea_content="<div class="option-row textarea-option cf" id="textarea-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>";
dropdown_content="<div class="option-row select-option cf" id="select-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>";
template_end="</div>";
[/ekm:nested_productoptions]
';
ifelse='';
[/ekm:if]
Below is an example of how you may want to customise your rpoduct options tag. This is complete with CSS.
Here is an example of how you may customise your product options.
<style type="text/css">
/* .clear {clear: both; color: [ekm:colour_1][/ekm:colour_1]} Use .cf instead */
.cf:before, .cf:after {content:"";display:table;}
.cf:after {clear:both;}
.cf {zoom:1;}
/* Product Options */
#product-options br {display:none;}
#product-options .option-row {margin: 10px 0;}
#product-options .option-row label {display: block; width: 150px; font-size: 12px; padding: 5px 5px 0;}
/* Text Field Styling */
#product-options .textfield-option input {border: solid 1px #ccc; background: #efefef; border-radius: 2px; box-shadow: 0 1px 0 0 #fff inset; padding: 5px; color: #666; width: 200px;}
#product-options .textfield-option input:focus {box-shadow: 0 -1px 0 0 #fff inset; outline: 0 none;}
/* Text Area Styling */
#product-options .textarea-option textarea {border: solid 1px #ccc; background: #efefef; border-radius: 2px; box-shadow: 0 1px 0 0 #fff inset; padding: 5px; color: #666; width: 200px;}
#product-options .textarea-option textarea:focus {box-shadow: 0 -1px 0 0 #fff inset; outline: 0 none;}
/* Select Box Styling */
#product-options .select-option select {border: solid 1px #ccc; background: #efefef; border-radius: 2px; box-shadow: 0 1px 0 0 #fff inset; padding: 5px; color: #666; width: 200px;}
#product-options .select-option select:focus {box-shadow: 0 -1px 0 0 #fff inset; outline: 0 none;}
</style>
[ekm:productoptions]
font_formatting='no';
remove_formatting='yes';
orderby='name ASC';
orderbyitems='name ASC, amount DESC';
template_start='<div id="product-options">';
textfield_content='<div class="option-row textfield-option cf" id="textfield-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
textarea_content='<div class="option-row textarea-option cf" id="textarea-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
dropdown_content='<div class="option-row select-dropdown cf" id="select-[option_counter]"><label for="options_[option_counter]">[option_title]</label> [option_item]</div>';
template_end='</div>';
[/ekm:productoptions]