new module:models/Variant(link, productId)
Constructs a new Variant
.
Document representing a product variation.
Parameters:
Name | Type | Description |
---|---|---|
link |
String | The URL addressing the product. |
productId |
String | The id (SKU) of the variant. |
- Source:
Members
(inner) link :String
The URL addressing the product.
Type:
- String
- Source:
(inner) orderable :Boolean
A flag indicating whether the variant is orderable.
Type:
- Boolean
- Source:
(inner) price :Number
The sales price of the variant.
Type:
- Number
- Source:
(inner) product_id :String
The id (SKU) of the variant.
Type:
- String
- Source:
(inner) variation_values :Object.<String, String>
The actual variation attribute id - value pairs.
Type:
- Object.<String, String>
- Source:
Methods
(static) constructFromObject(data, obj) → {module:models/Variant}
Constructs a Variant
from a plain JavaScript object, optionally creating a new instance.
Copies all relevant properties from data
to obj
if supplied or a new instance if not.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | The plain JavaScript object bearing properties of interest. |
obj |
module:models/Variant | Optional instance to populate. |
- Source:
Returns:
The populated Variant
instance.