VariantAvailableOptions
Summary
The VariantAvailableOptions loop lets you display various details about the variant options that are available as for the extended variants at the product.
Examples
Basic usage
Notice the use of @item.GetValue to get data from the loop variable.
If you just write @GetValue, the data will be taken from outside the loop.
Similarly, you have to use @item.GetLoop to use loops inside a loop.
Check if the loop exists
Example of usage
The following general example illustrates how to use a loop construct.
Check if the loop exists
Available tags
Ecom:VariantOption.[PropertySystemName]
Returns the value from the variant property field.
@GetString("Ecom:VariantOption.[PropertySystemName]")
Ecom:VariantOption.ImgLarge
Returns the large image of the variant.
@GetString("Ecom:VariantOption.ImgLarge")
Ecom:VariantOption.ImgLarge.Clean
Returns an URL to the large image of the variant.
@GetString("Ecom:VariantOption.ImgLarge.Clean")
Ecom:VariantOption.ImgMedium
Returns the medium image of the variant.
@GetString("Ecom:VariantOption.ImgMedium")
Ecom:VariantOption.ImgMedium.Clean
Returns an URL to the medium image of the variant.
@GetString("Ecom:VariantOption.ImgMedium.Clean")
Ecom:VariantOption.ImgSmall
Returns the small image of the variant.
@GetString("Ecom:VariantOption.ImgSmall")
Ecom:VariantOption.ImgSmall.Clean
Returns an URL to the small image of the variant.
@GetString("Ecom:VariantOption.ImgSmall.Clean")
Ecom:VariantOption.Name
Returns the name of the variant.
@GetString("Ecom:VariantOption.Name")
Ecom:VariantOption.Selected
Returns True if the variant option is selected in frontend.
@GetBoolean("Ecom:VariantOption.Selected")
Ecom:VariantOption.SortOrder
Returns the sort order of the variant.
@GetInteger("Ecom:VariantOption.SortOrder")
Available loops
VariantGroupProperties
The VariantGroupProperties
loop lets you display propertie's data within variant group.
@foreach (LoopItem item in GetLoop("VariantGroupProperties")){ <p>@item.GetValue("TagName")</p> }