Ecom:Product.HaveDiscount

Version: - boolean  

Summary

Returns the value "True" if the product has a discount - if not an empty string is returned.

Settings

The value is generated automatically.

Remarks

The tag can be used in If defined to show elements only on products with a discunt.

The tag is only visible in the template tag list when you have an active product discount.

Examples

Outputting the template tag

@GetBoolean("Ecom:Product.HaveDiscount")

Check if tag has a value

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

Assign tag to a value for later use

@{ bool storedTag = GetBoolean("Ecom:Product.HaveDiscount"); }

Outputting the template tag

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

Check if boolean has a value

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