get_product_variations

Extract all the variations associated to a product.

Accepted Parameters

ParameterExampleRequiredExplanation
product_id1234YWhich product will be used to extract the variations.
attributesattributesYThis is the name of the variables you would like the results of your query to be placed in. For example, if you set this to "attributes" then the items returned by this method will be loaded into the $attributes template variable.

Example using template

        {get_product_variations product_id="4" attributes="attributes"}
        {include file="products/attributes.tpl.html"}

Output Data

As described in the Accepted Parameters section, the attribute data will be put into your nominated variable. Said variable will then contain the following data for your use, where 'x' is the name of your variable.

ParameterExampleTypeDescription
x[].id1234AttributeThis is the name of the variables you would like the results of your query to be placed in. For example, if you set this to "attributes" then the items returned by this method will be loaded into the $attributes template variable.
x[].attribute_nameSizeStringThe Name is configured via the Aurora Back-end under the Product > Attributes section.
x[].attribute_promptConfigurable TextStringThe Prompt is configured via the Aurora Back-end under the Product > Attributes section.
x[].attribute_confirmationConfigurable TextStringThe Confirmation is configured via the Aurora Back-end under the Product > Attributes section.
x[].attribute_infoConfigurable TextStringThe Info is configured via the Aurora Back-end under the Product > Attributes section.
x[].attribute_typeselectStringThe type is configured via the Aurora Back-end under the Product > Attributes section and can be one of [select, checkbox, image, radio, rating ].
x[].attribute_required11|0Describes whether the attribute is required (1) or optional (0).
x[].priority0IntegerThis value dictates in what order the attribute should be displayed (0/Zero first and then getting larger).
x[].valuesN/AArray of ValuesThis array contains the attribute's available values for the provided product_id.
x[].values[].id123123IntegerThe Unique ID used by Aurora to identify an attribute.
x[].values[].attribute_value10StringThe value's display text.
x[].values[].attribute_value_abbreviationsiStringThe value's abbreviouse (often used for filter URLs).
x[].values[].has_image11|0Whether an image has been uploaded for an attribute.
x[].values[].is_default01|0Whether the attribute is considered the default attribute (1) or not (0).
x[].values[].variation_referenceVU1039E4StringThe Reference is configured via the Aurora Back-end under the All Products > Edit section.
x[].values[].variation_upcUPCN29RStringThe UPC is configured via the Aurora Back-end under the All Products > Edit section.
x[].values[].variation_eanEANNFD8024StringThe EAN is configured via the Aurora Back-end under the All Products > Edit section.
x[].values[].variation_price12.99FloatThe Price of the variation in the currently selected Currency.
x[].values[].variation_stock3IntegerThe Reference is configured via the Aurora Back-end under the All Products > Edit section.
x[].values[].variation_pre_order_stock4IntegerThe Reference is configured via the Aurora Back-end under the All Products > Edit section.
x[].values[].available11|0Whether this variation is Live and available for purchase.

Note: Depending on your store settings, unavailable variations may not appear here at all.
x[].values[].variation_id214113IntegerThe Unique ID used by Aurora to identify a variation.
x[].values[].fieldsN/AAssociative Array of Variation Additional FieldsVariations can have additional fields attached to them. When they do, they are included here for your use.
x[].values[].fields.field_nameField ValueString