Exemple #1
0
 public static PriceAndMarket GetDiscountPrice(this List <VariationContent> variations, IMarket market = null)
 {
     if (variations.Any())
     {
         VariationContent variationContent = variations.FirstOrDefault(x => x.GetPricesWithMarket(market) != null);
         return(variationContent.GetDiscountPrice(market));
     }
     return(null);
 }
        public static PriceModel GetPriceModel(this VariationContent currentContent, IMarket market)
        {
            PriceModel priceModel = new PriceModel();

            priceModel.DefaultPrice      = currentContent.GetPrice(market);
            priceModel.DiscountPrice     = currentContent.GetDiscountPrice(market);
            priceModel.CustomerClubPrice = currentContent.GetCustomerClubPrice(market);
            return(priceModel);
        }
        protected void PopulatePrices(VariationContent content, IMarket currentMarket)
        {
            PriceString = content.GetDisplayPrice(currentMarket);
            PriceAmount = content.GetDefaultPriceAmount(currentMarket);

            var discountPriceAmount = content.GetDiscountPrice();

            DiscountPriceAmount = GetPriceWithCheck(discountPriceAmount);
            DiscountPriceString = GetDisplayPriceWithCheck(discountPriceAmount);

            DiscountPriceAvailable = DiscountPriceAmount > 0;

            var customerClubPriceAmount = content.GetCustomerClubPrice();

            CustomerClubMemberPriceAmount = GetPriceWithCheck(customerClubPriceAmount);
            CustomerClubMemberPriceString = GetDisplayPriceWithCheck(customerClubPriceAmount);

            CustomerPriceAvailable = CustomerClubMemberPriceAmount > 0;
        }
        protected void PopulatePrices(VariationContent content, IMarket currentMarket)
        {
            PriceString = content.GetDisplayPrice(currentMarket);
            PriceAmount = content.GetDefaultPriceAmount(currentMarket);

            var discountPriceAmount = content.GetDiscountPrice();
            DiscountPriceAmount = GetPriceWithCheck(discountPriceAmount);
            DiscountPriceString = GetDisplayPriceWithCheck(discountPriceAmount);

            DiscountPriceAvailable = DiscountPriceAmount > 0;

            var customerClubPriceAmount = content.GetCustomerClubPrice();
            CustomerClubMemberPriceAmount = GetPriceWithCheck(customerClubPriceAmount);
            CustomerClubMemberPriceString = GetDisplayPriceWithCheck(customerClubPriceAmount);

            CustomerPriceAvailable = CustomerClubMemberPriceAmount > 0;
        }