Example #1
0
 /// <summary>
 /// Gets the discount price, if no discount is set, returns string.Empty
 /// </summary>
 /// <param name="variations">All variants for a product</param>
 /// <param name="defaultPrice">The price to compare against</param>
 /// <param name="market">The market.</param>
 /// <returns></returns>
 public static string GetDiscountDisplayPrice(this List <VariationContent> variations, Price defaultPrice, IMarket market = null)
 {
     if (variations.Any())
     {
         VariationContent variationContent = variations.FirstOrDefault(x => x.GetPricesWithMarket(market) != null);
         return(variationContent.GetDiscountDisplayPrice(defaultPrice, market));
     }
     return(string.Empty);
 }
Example #2
0
        public static PriceModel GetPriceModel(this VariationContent currentContent)
        {
            PriceModel priceModel = new PriceModel();

            priceModel.Price = GetPrice(currentContent);
            priceModel.DiscountDisplayPrice     = currentContent.GetDiscountDisplayPrice(currentContent.GetDefaultPrice());
            priceModel.CustomerClubDisplayPrice = currentContent.GetCustomerClubDisplayPrice();
            return(priceModel);
        }
Example #3
0
        protected virtual PriceModel GetPriceModel(VariationContent currentContent)
        {
            PriceModel priceModel = new PriceModel();

            priceModel.Price = GetPrice(currentContent);
            priceModel.DiscountDisplayPrice     = currentContent.GetDiscountDisplayPrice(currentContent.GetDefaultPrice());
            priceModel.CustomerClubDisplayPrice = currentContent.GetCustomerClubDisplayPrice();
            return(priceModel);
        }