@model ProductDetailsModel.ProductPriceModel @using Nop.Core @using Nop.Core.Domain.Catalog @using Nop.Core.Domain.Tax @using Nop.Core.Infrastructure @using Nop.Web.Models.Catalog; @using System.Globalization; @using System.Text.RegularExpressions; @{ var dynamicPriceUpdate = EngineContext.Current.Resolve().EnableDynamicPriceUpdate; var dynamicPriceUpdateAjax = EngineContext.Current.Resolve().DynamicPriceUpdateAjax; var dynamicPriceUpdateSupported = dynamicPriceUpdate && !dynamicPriceUpdateAjax; string dynamicPricePattern = "(?(\\d+[\\s\\,\\.]?)+)"; string dynamicPriceReplacement = String.Format("${{val}} ", Model.ProductId); } @if (dynamicPriceUpdateSupported) { }
@if (Model.CustomerEntersPrice) { @*display nothing*@ } else if (Model.CallForPrice) { @*call for price*@
@T("Products.CallForPrice")
} else { if (Model.IsRental) {
@Model.RentalPrice
} if (!String.IsNullOrWhiteSpace(Model.OldPrice)) { @*old price*@
@Model.OldPrice
}
@if (!String.IsNullOrWhiteSpace(Model.OldPrice) || !String.IsNullOrWhiteSpace(Model.PriceWithDiscount)) { @*display "Price:" label if we have old price or discounted one*@ } @*render price*@ itemprop="price" class="price-value-@(Model.ProductId)" }> @if (dynamicPriceUpdateSupported && !Model.HidePrices && String.IsNullOrWhiteSpace(Model.PriceWithDiscount)) { @Html.Raw(Regex.Replace(Model.Price, dynamicPricePattern, dynamicPriceReplacement)) } else { @Html.Raw(Model.Price) }
if (!String.IsNullOrWhiteSpace(Model.PriceWithDiscount)) { @*discounted price*@
@if (dynamicPriceUpdateSupported && !Model.HidePrices) { @Html.Raw(Regex.Replace(Model.PriceWithDiscount, dynamicPricePattern, dynamicPriceReplacement)) } else { @Html.Raw(Model.PriceWithDiscount) }
} if (Model.DisplayTaxShippingInfo) { var inclTax = EngineContext.Current.Resolve().TaxDisplayType == TaxDisplayType.IncludingTax; //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here //of course, you can modify appropriate locales to include VAT info there
@T(inclTax ? "Products.Price.TaxShipping.InclTax" : "Products.Price.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") }))
} if (!String.IsNullOrEmpty(Model.CurrencyCode)) { } }