Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do you go about checking if a property exists and has value? "HasValue(string)" seems to only check if the property exists at all?
@if(@product.Node.HasProperty("productSalePrice")){ <span class="price">Price: <span class="salePrice">@product.OriginalPrice.ToString("C")</span> @product.Node.GetProperty("productSalePrice")</span> } else { <span class="price">Price: @product.OriginalPrice.ToString("C")</span> }
Got it!
@if(@product.Node.HasProperty("productSalePrice") && @product.Node.GetProperty("productSalePrice").Value != String.Empty)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Check if property exists and has value
How do you go about checking if a property exists and has value? "HasValue(string)" seems to only check if the property exists at all?
Got it!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.