Version: - integer  


Returns the number of related products. Includes both active and inactive products.


The value is generated automatically and is based on the number of products selected on the Related tab for a product. 

(Ecommerce > Product Catalog > Shop > Product group > Product > Related tab)


If you only want to show the number of active related products, you can use the tag: Ecom:Product.RelatedCount.VisibleInFrontend.


Outputting the template tag


Check if tag has a value

@if(!int.IsNullOrWhiteSpace(GetInteger("Ecom:Product.RelatedCount"))) { @* Tag has value, so let's do something useful here. *@ }

Assign tag to a value for later use

@{ int storedTag = GetInteger("Ecom:Product.RelatedCount"); }

Outputting the template tag


Check if integer has a value

<!--@If Defined(@Ecom:Product.RelatedCount)--> Let's output this tag here: <strong><!--@Ecom:Product.RelatedCount--></strong> <!--@EndIf(@Ecom:Product.RelatedCount)-->