Skip to content

ProductOptionValue

The ProductOptionValue object represents a single value which can be selected for a given option of type select or radio.

classDiagram
  direction LR
  Product --> ProductOptionsList
  ProductOptionsList "1" --o "*" ProductOption
  ProductOption --> ProductOptionValuesList
  ProductOption --> ProductOptionValuesWithColorList
  ProductOptionValue --> Price
  ProductOptionValue --> ProductOption
  ProductOptionValue --> ProductImage
  ProductOptionValuesList "1" --o "*" ProductOptionValue
  ProductOptionValuesWithColorList "1" --o "*" ProductOptionValueWithColor
  class Product{
  }
  class ProductOptionsList{
  }
  class ProductOptionValuesList{
  }
  class ProductOptionValuesWithColorList{
  }
  class ProductOptionValue{
    int id
    int order
    string name
    bool isAvailable
    bool isPriceModifier
    bool isPercentagePriceModifier
    ?Price priceModification
    float percentagePriceModification
    string formatPercentagePriceModification
    ProductOption option
    ProductImage productImage
  }
  class ProductOptionValueWithColor{
  }
  class ProductOption{
  }  
  class Price{
  }  
  class ProductImage{
  }

Properties

Attribute name Type Description
id int The unique identifier of the value of an option.
order int The order of the value of an option.
name string The name of the value of an option.
isAvailable bool Whether there is at least one available product variant with this value of an option.
isPriceModifier bool Whether the value is used to modify the price of the product.
isPercentagePriceModifier bool Whether the value is used to modify the price of the product by a percentage.
priceModification null|Price The price modification of this value represented by a Price Object. If the value is not a price modifier, this property is null.
percentagePriceModification float The percentage price modification of this value. If the value is not a percentage price modifier, this is set to zero (0.00).
formatPercentagePriceModification string The formatted percentage price modification of this value. If the value is not a percentage price modifier, this is set to zero (0.00).
option ProductOption The ProductOption object associated with this value.
productImage ProductImage The ProductImage object associated with this value.

Examples

id property

{{ productOptionValue.id }}
1

order property

{{ productOptionValue.order }}
2

name property

{{ productOptionValue.name }}
Example name

isAvailable property

{{ productOptionValue.isAvailable }}
true

isPriceModifier property

{{ productOptionValue.isPriceModifier }}
true

isPercentagePriceModifier property

{{ productOptionValue.isPercentagePriceModifier }}
true

priceModification property

{{ productOptionValue.priceModification.formatGross }}
$11.00

percentagePriceModification property

{{ productOptionValue.percentagePriceModification }}
10

formatPercentagePriceModification property

{% if productOptionValue.isPercentagePriceModifier %}
    {{ productOptionValue.percentagePriceModification }} => {{ productOptionValue.formatPercentagePriceModification }}
{% endif %}
10 => 10%

option property

{{ productOptionValue.option.name }}
Name of option

productImage property

{{ productOptionValue.productImage.url }}
/link/to/image