HomeHome Product Discus... Product Discus...RazorCartRazorCartCustomizing Item pages, Hiding Sale price if no sale price existsCustomizing Item pages, Hiding Sale price if no sale price exists
Previous
 
Next
New Post
7/17/2019 1:05 PM
 
Hi, 

I am trying to make a customization to my RazorCart's item page that will hide the sale price line unless the item has a sale price.  I am trying to use an @if statement to get this done, but dont know exactly how to code it...

@if (Model.Product.Has????????)
{
<h3 ng-class="{'rzc-sale': details.isSaleEnabled && details.product.IsUnderSale}">Sale Price:<span class="salesprice"> {{details.product.SalePrice | currency : '@Model.Culture.NumberFormat.CurrencySymbol' : @Model.Culture.NumberFormat.CurrencyDecimalDigits}}</span>
</h3>
}

Where i have the  ???????? is where my issue is.  I have tried using SalePrice from the details.product.SalePrice line, but it just gives me an error.  

I am sure this is a simple fix, i just am not having any luck figuring it out.  

Can anyone help me real quick with the right @if call to get this to work.  Thanks
 
New Post
7/22/2019 1:11 PM
 
Hi Rich,

You Can use @If (Model.Product.IsUnderSale) { ... } to check if the product has an active sale price.

You may get a full IntelliSense if you download the Visual Studio project for managing the viewsets files: https://helpdesk.smith-consulting.com...g-viewsets.aspx
If you want to quickly check the model and properties from the browser, right click on any element within the module > Inspect Element (this will select the HTML element in the browser's Dev tool inspector) > switch to the Console's tab > execute: angular.element($0).controller().product or angular.element($0).controller() for the full model.

Regards,
Wael
 
Previous
 
Next
HomeHome Product Discus... Product Discus...RazorCartRazorCartCustomizing Item pages, Hiding Sale price if no sale price existsCustomizing Item pages, Hiding Sale price if no sale price exists