Variants are Craft Elements and also Purchasables.
VariantModel’s have the following attributes and methods:
The variants title as generated by the title formatter on the product type definition.
The id of the variant in the system.
Returns this variant’s id - as variants are purchasables.
Returns this variant’s Product Model
The listing price of the variant.
The price of the variant after sales have been applied. Will be equal to price if no sales were applicable.
The sku of the variant.
false if this variant is the default variant of a product.
false if this variant has unlimited stock
Returns the stock count on hand, or zero if unlimitedStock is true.
The maximum quanity orderable for this variant (in a single cart/order)
The minimum quanity orderable for this variant (in a single cart/order)
The variants weight
The variants height
The variants length
The variants width
The url to edit this variant’s edit page in the control panel.
Returns the order number of the variant as defined in the CP product edit screen.
false when any sales are applied to this variant. This is just a helper to test if there is a saleAmount not equal to zero.
The description of the purchasable which is the result of the product type’s ‘Order Description Format’ option.