本文整理汇总了C#中IPriceFormatter.FormatRentalProductPeriod方法的典型用法代码示例。如果您正苦于以下问题:C# IPriceFormatter.FormatRentalProductPeriod方法的具体用法?C# IPriceFormatter.FormatRentalProductPeriod怎么用?C# IPriceFormatter.FormatRentalProductPeriod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPriceFormatter
的用法示例。
在下文中一共展示了IPriceFormatter.FormatRentalProductPeriod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareProductOverviewModels
//.........这里部分代码省略.........
{
tierPrices.AddRange(product.TierPrices
.OrderBy(tp => tp.Quantity)
.ToList()
.FilterByStore(storeContext.CurrentStore.Id)
.FilterForCustomer(workContext.CurrentCustomer)
.RemoveDuplicatedQuantities());
}
//When there is just one tier (with qty 1),
//there are no actual savings in the list.
bool displayFromMessage = tierPrices.Count > 0 &&
!(tierPrices.Count == 1 && tierPrices[0].Quantity <= 1);
if (displayFromMessage)
{
priceModel.OldPrice = null;
priceModel.Price = String.Format(localizationService.GetResource("Products.PriceRangeFrom"), priceFormatter.FormatPrice(finalPrice));
}
else
{
if (finalPriceBase != oldPriceBase && oldPriceBase != decimal.Zero)
{
priceModel.OldPrice = priceFormatter.FormatPrice(oldPrice);
priceModel.Price = priceFormatter.FormatPrice(finalPrice);
}
else
{
priceModel.OldPrice = null;
priceModel.Price = priceFormatter.FormatPrice(finalPrice);
}
}
if (product.IsRental)
{
//rental product
priceModel.OldPrice = priceFormatter.FormatRentalProductPeriod(product, priceModel.OldPrice);
priceModel.Price = priceFormatter.FormatRentalProductPeriod(product, priceModel.Price);
}
//property for German market
//we display tax/shipping info only with "shipping enabled" for this product
//we also ensure this it's not free shipping
priceModel.DisplayTaxShippingInfo = catalogSettings.DisplayTaxShippingInfoProductBoxes
&& product.IsShipEnabled &&
!product.IsFreeShipping;
}
}
}
else
{
//hide prices
priceModel.OldPrice = null;
priceModel.Price = null;
}
#endregion
}
break;
}
model.ProductPrice = priceModel;
#endregion
}
//picture
if (preparePictureModel)
{