ProductCustomisation

Extends Object. Represents a group of options available to customise a product. Retrieving customisation options is always done from a product object:

<body>
    <div>
        <h1>Customise {{ product.title }}</h1>
        
        <?ev
            for(var i in product.customisations){
                // the customisation group
                var group = product.customisations[i];
        ?>
            <h2>{{ group.title }}</h2>
            <p>{{ group.description }}</p>
            <ev:select>
            <?ev 
                for(var o in group.options){
                    var option = '<option />'.toDom();
                    option.attr('value', group.options[o].value);
                    option.text(group.options[o].value);
                    print(option);
                }
            ?>
            </ev:select>
        <?ev } ?>
    </div>
</body>

Note, this is a very simplified view of how to use product customisations.

Properties
description

Type String

The description for the customisation group.

id

Type Number

The System ID for the customisation group.

isSelect

Type Boolean

True if the group widget requires the user to select from a list, else false.

isText

Type Boolean

True if the user is allowed to enter text into a textfield, else false.

options

Type Array

When the group requires the user to select from a list. Each option in the Array will have the following properties:

  • Number:id - the System ID for the option
  • String:value - the value for the option
  • Boolean:selected - true if the option is selected by default
title

Type String

The title for the customisation group.

required

Type Boolean

True if the user must add or select a value for the customisation group, else false.

type

Type String

The type of widget to use for the customisation option.