Ecom:Product.VariantCount
Version: - integerSummary
Returns the number of variants available for the product.
Settings
The value is generated automatically and is based on the number of variants selected on the Variants tab for a product.
(Ecommerce > Product Catalog > Shop > Product group > Product > Variants tab)
Examples
Outputting the template tag
@GetInteger("Ecom:Product.VariantCount")
Check if tag has a value
@if(!int.IsNullOrWhiteSpace(GetInteger("Ecom:Product.VariantCount"))) {
@* Tag has value, so let's do something useful here. *@
}
Assign tag to a value for later use
@{
int storedTag = GetInteger("Ecom:Product.VariantCount");
}
Outputting the template tag
<!--@Ecom:Product.VariantCount-->
Check if integer has a value
<!--@If Defined(@Ecom:Product.VariantCount)-->
Let's output this tag here: <strong><!--@Ecom:Product.VariantCount--></strong>
<!--@EndIf(@Ecom:Product.VariantCount)-->