Ecom:Product.RelatedCount

Version: - integer  

Summary

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

Settings

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)

Remarks

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

Examples

Outputting the template tag

@GetInteger("Ecom:Product.RelatedCount")

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

<!--@Ecom:Product.RelatedCount-->

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)-->