Overview

Represents a value of variant or template option that is associated to a specific Orderline.

It allows access to variant/template option types and variant/template_option values associated with the choice.

Properties

chosen_option.key

Returns the key under which the option is stored on the orderline. This typically corresponds to the associated variant or template option type's code.

chosen_option.value

Returns the value stored on the orderline for this option. This typically corresponds to the associated variant or template option variant's code. In case of text variants/template options, it contains the text provided by the user.

chosen_option.variant

If this option represents a variant, returns the corresponding OptionType object, otherwise returns nil.

chosen_option.variant_value

If this option represents a multiple choice variant, returns the corresponding OptionValue object, otherwise returns nil.

chosen_option.template_option

If this option represents a template option, returns the corresponding OptionType object, otherwise returns nil.

chosen_option.template_option_value

If this option represents a multiple choice template option, returns the corresponding OptionValue object, otherwise returns nil.

chosen_option.option_type

This is equivalent to chosen_option.variant if option represents a product variant, or chosen_option.template_option if it represents a template option.

chosen_option.option_value

This is equivalent to chosen_option.variant_value if option represents a product variant, or chosen_option.template_option_value if it represents a template option.