Ejemplo n.º 1
0
        /// <summary>
        /// Gets the product price.
        /// </summary>
        /// <param name="visitorContext">The visitor context.</param>
        /// <param name="productViewModel">The product view model.</param>
        public virtual void GetProductPrice([NotNull] VisitorContext visitorContext, ProductViewModel productViewModel)
        {
            if (productViewModel == null)
            {
                return;
            }

            bool includeVariants = productViewModel.Variants != null && productViewModel.Variants.Count > 0;
            var  pricesResponse  = this.PricingManager.GetProductPrices(StorefrontManager.CurrentStorefront, visitorContext, productViewModel.CatalogName, productViewModel.ProductId, includeVariants, null);

            if (pricesResponse != null && pricesResponse.ServiceProviderResult.Success && pricesResponse.Result != null)
            {
                Price price;
                if (pricesResponse.Result.TryGetValue(productViewModel.ProductId, out price))
                {
                    ExtendedCommercePrice extendedPrice = (ExtendedCommercePrice)price;
                    productViewModel.ListPrice     = price.Amount;
                    productViewModel.AdjustedPrice = extendedPrice.ListPrice;
                }

                if (includeVariants)
                {
                    foreach (var variant in productViewModel.Variants)
                    {
                        if (pricesResponse.Result.TryGetValue(variant.VariantId, out price))
                        {
                            ExtendedCommercePrice extendedPrice = (ExtendedCommercePrice)price;

                            variant.ListPrice     = extendedPrice.Amount;
                            variant.AdjustedPrice = extendedPrice.ListPrice;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the product price.
        /// </summary>
        /// <param name="visitorContext">The visitor context.</param>
        /// <param name="productViewModels">The product view models.</param>
        public virtual void GetProductBulkPrices([NotNull] VisitorContext visitorContext, List <ProductViewModel> productViewModels)
        {
            if (productViewModels == null || !productViewModels.Any())
            {
                return;
            }

            var catalogName = productViewModels.Select(p => p.CatalogName).First().ToString();
            var productIds  = productViewModels.Select(p => p.ProductId).ToList();

            var pricesResponse = this.PricingManager.GetProductBulkPrices(StorefrontManager.CurrentStorefront, visitorContext, catalogName, productIds, null);
            var prices         = pricesResponse != null && pricesResponse.Result != null ? pricesResponse.Result : new Dictionary <string, Price>();

            foreach (var productViewModel in productViewModels)
            {
                Price price;
                if (prices.Any() && prices.TryGetValue(productViewModel.ProductId, out price))
                {
                    ExtendedCommercePrice extendedPrice = (ExtendedCommercePrice)price;

                    productViewModel.ListPrice     = extendedPrice.Amount;
                    productViewModel.AdjustedPrice = extendedPrice.ListPrice;

                    productViewModel.LowestPricedVariantAdjustedPrice  = extendedPrice.LowestPricedVariant;
                    productViewModel.LowestPricedVariantListPrice      = extendedPrice.LowestPricedVariantListPrice;
                    productViewModel.HighestPricedVariantAdjustedPrice = extendedPrice.HighestPricedVariant;
                }
            }
        }
 /// <summary>
 /// Sets the variant prices.
 /// </summary>
 /// <param name="productFamily">The product family.</param>
 /// <param name="extendedPrice">The extended price.</param>
 /// <param name="isLowestPriceVariantSpecified">if set to <c>true</c> the lowest priced variant adjusted price is returned.</param>
 /// <param name="isLowestPriceVariantListPriceSpecified">if set to <c>true</c> the lowest priced variant list price is returned.</param>
 /// <param name="isHighestPriceVariantSpecified">if set to <c>true</c> the highest priced variant adjusted price.</param>
 protected virtual void SetVariantPrices(ProductFamily productFamily, ExtendedCommercePrice extendedPrice, bool isLowestPriceVariantSpecified, bool isLowestPriceVariantListPriceSpecified, bool isHighestPriceVariantSpecified)
 {
     if (this.UseProductBasePriceAsVariantPrice)
     {
         this.SetVariantPricesFromBaseProduct(productFamily, extendedPrice, isLowestPriceVariantSpecified, isLowestPriceVariantListPriceSpecified, isHighestPriceVariantSpecified);
     }
     else
     {
         this.SetVariantPricesFromProductVariants(productFamily, extendedPrice, isLowestPriceVariantSpecified, isLowestPriceVariantListPriceSpecified, isHighestPriceVariantSpecified);
     }
 }
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public override void Process(Commerce.Pipelines.ServicePipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Request, "args.request");
            Assert.ArgumentCondition(args.Request is GetProductBulkPricesRequest, "args.Request", "args.Request is GetProductBulkPricesRequest");
            Assert.ArgumentCondition(args.Result is Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult, "args.Result", "args.Result is GetProductBulkPricesResult");

            GetProductBulkPricesRequest request = (GetProductBulkPricesRequest)args.Request;

            Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult result = (Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult)args.Result;

            Assert.ArgumentNotNull(request.ProductCatalogName, "request.ProductCatalogName");
            Assert.ArgumentNotNull(request.ProductIds, "request.ProductIds");
            Assert.ArgumentNotNull(request.PriceType, "request.PriceType");

            var uniqueIds             = request.ProductIds.ToList().Distinct();
            var productSearchItemList = this.GetProductsFromIndex(request.ProductCatalogName, uniqueIds);

            foreach (var productSearchItem in productSearchItemList)
            {
                var foundId = uniqueIds.SingleOrDefault(x => x == productSearchItem.Name);
                if (foundId == null)
                {
                    continue;
                }

                if (productSearchItem != null)
                {
                    // SOLR returns 0 and not <null> for missing prices.  We set the prices to null when 0 value is encountered.
                    decimal?listPrice     = !productSearchItem.OtherFields.ContainsKey("listprice") ? (decimal?)null : (productSearchItem.ListPrice == 0 ? (decimal?)null : (decimal)productSearchItem.ListPrice);
                    decimal?adjustedPrice = !productSearchItem.OtherFields.ContainsKey("adjustedprice") ? (decimal?)null : (productSearchItem.AdjustedPrice == 0 ? (decimal?)null : (decimal)productSearchItem.AdjustedPrice);

                    ExtendedCommercePrice extendedPrice = this.EntityFactory.Create <ExtendedCommercePrice>("Price");

                    if (adjustedPrice.HasValue)
                    {
                        extendedPrice.ListPrice = adjustedPrice.Value;
                    }
                    else
                    {
                        // No base price is defined, the List price is set to the actual ListPrice define in the catalog
                        extendedPrice.ListPrice = (listPrice.HasValue) ? listPrice.Value : 0M;
                    }

                    // The product list price is the Connect "Adjusted" price.
                    if (listPrice.HasValue)
                    {
                        extendedPrice.Amount = listPrice.Value;
                    }

                    result.Prices.Add(foundId, extendedPrice);
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets the variant prices by looping through all of the variants returned by the index.
        /// </summary>
        /// <param name="productDocument">The product document.</param>
        /// <param name="variantInfoList">The variant information list.</param>
        /// <param name="extendedPrice">The extended price.</param>
        /// <param name="isLowestPriceVariantSpecified">if set to <c>true</c> the lowest priced variant adjusted price is returned.</param>
        /// <param name="isLowestPriceVariantListPriceSpecified">if set to <c>true</c> the lowest priced variant list price is returned.</param>
        /// <param name="isHighestPriceVariantSpecified">if set to <c>true</c> the highest priced variant adjusted price.</param>
        protected virtual void SetVariantPricesFromProductVariants(
            CommerceProductSearchResultItem productDocument,
            List <VariantIndexInfo> variantInfoList,
            ExtendedCommercePrice extendedPrice,
            bool isLowestPriceVariantSpecified,
            bool isLowestPriceVariantListPriceSpecified,
            bool isHighestPriceVariantSpecified)
        {
            if (variantInfoList != null && variantInfoList.Count > 0)
            {
                decimal highestPrice        = 0.0M;
                decimal lowestPrice         = 0.0M;
                decimal basePrice           = 0.0M;
                bool    processingFirstItem = true;

                foreach (var variantInfo in variantInfoList)
                {
                    if (processingFirstItem || variantInfo.ListPrice < lowestPrice)
                    {
                        lowestPrice = variantInfo.ListPrice;
                        basePrice   = variantInfo.BasePrice;
                    }

                    if (processingFirstItem || variantInfo.ListPrice > highestPrice)
                    {
                        highestPrice = variantInfo.ListPrice;
                    }

                    processingFirstItem = false;
                }

                if (isLowestPriceVariantSpecified)
                {
                    extendedPrice.LowestPricedVariant = lowestPrice;
                }

                if (isLowestPriceVariantListPriceSpecified)
                {
                    extendedPrice.LowestPricedVariantListPrice = basePrice;
                }

                if (isHighestPriceVariantSpecified)
                {
                    extendedPrice.HighestPricedVariant = highestPrice;
                }
            }
        }
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public override void Process(Commerce.Pipelines.ServicePipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Request, "args.request");
            Assert.ArgumentCondition(args.Request is GetProductPricesRequest, "args.Request", "args.Request is GetProductPricesRequest");
            Assert.ArgumentCondition(args.Result is Sitecore.Commerce.Services.Prices.GetProductPricesResult, "args.Result", "args.Result is GetProductPricesResult");

            GetProductPricesRequest request = (GetProductPricesRequest)args.Request;

            Sitecore.Commerce.Services.Prices.GetProductPricesResult result = (Sitecore.Commerce.Services.Prices.GetProductPricesResult)args.Result;

            Assert.ArgumentNotNull(request.ProductCatalogName, "request.ProductCatalogName");
            Assert.ArgumentNotNull(request.ProductId, "request.ProductId");
            Assert.ArgumentNotNull(request.PriceTypeIds, "request.PriceTypeIds");

            ICatalogRepository catalogRepository = ContextTypeLoader.CreateInstance <ICatalogRepository>();
            bool isList     = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.List, StringComparison.OrdinalIgnoreCase)) != null;
            bool isAdjusted = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.Adjusted, StringComparison.OrdinalIgnoreCase)) != null;

            try
            {
                var product = catalogRepository.GetProductReadOnly(request.ProductCatalogName, request.ProductId);

                ExtendedCommercePrice extendedPrice = this.EntityFactory.Create <ExtendedCommercePrice>("Price");

                // BasePrice is a List price and ListPrice is Adjusted price
                if (isList)
                {
                    if (product.HasProperty("BasePrice") && product["BasePrice"] != null)
                    {
                        extendedPrice.Amount = (product["BasePrice"] as decimal?).Value;
                    }
                    else
                    {
                        // No base price is defined, the List price is set to the actual ListPrice define in the catalog
                        extendedPrice.Amount = product.ListPrice;
                    }
                }

                if (isAdjusted && !product.IsListPriceNull())
                {
                    extendedPrice.ListPrice = product.ListPrice;
                }

                result.Prices.Add(request.ProductId, extendedPrice);

                if (request.IncludeVariantPrices && product is ProductFamily)
                {
                    foreach (Variant variant in ((ProductFamily)product).Variants)
                    {
                        ExtendedCommercePrice variantExtendedPrice = this.EntityFactory.Create <ExtendedCommercePrice>("Price");

                        bool hasBasePrice = product.HasProperty("BasePrice");

                        if (hasBasePrice && variant["BasePriceVariant"] != null)
                        {
                            variantExtendedPrice.Amount = (variant["BasePriceVariant"] as decimal?).Value;
                        }

                        if (!variant.IsListPriceNull())
                        {
                            variantExtendedPrice.ListPrice = variant.ListPrice;

                            if (!hasBasePrice)
                            {
                                variantExtendedPrice.Amount = variant.ListPrice;
                            }
                        }

                        result.Prices.Add(variant.VariantId.Trim(), variantExtendedPrice);
                    }
                }
            }
            catch (EntityDoesNotExistException e)
            {
                result.Success = false;
                result.SystemMessages.Add(new SystemMessage {
                    Message = e.Message
                });
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public override void Process(Commerce.Pipelines.ServicePipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Request, "args.request");
            Assert.ArgumentCondition(args.Request is GetProductBulkPricesRequest, "args.Request", "args.Request is GetProductBulkPricesRequest");
            Assert.ArgumentCondition(args.Result is Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult, "args.Result", "args.Result is GetProductBulkPricesResult");

            GetProductBulkPricesRequest request = (GetProductBulkPricesRequest)args.Request;

            Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult result = (Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult)args.Result;

            Assert.ArgumentNotNull(request.ProductCatalogName, "request.ProductCatalogName");
            Assert.ArgumentNotNull(request.ProductIds, "request.ProductIds");
            Assert.ArgumentNotNull(request.PriceType, "request.PriceType");

            bool isList     = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.List, StringComparison.OrdinalIgnoreCase)) != null;
            bool isAdjusted = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.Adjusted, StringComparison.OrdinalIgnoreCase)) != null;
            bool isLowestPriceVariantSpecified          = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.LowestPricedVariant, StringComparison.OrdinalIgnoreCase)) != null;
            bool isLowestPriceVariantListPriceSpecified = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.LowestPricedVariantListPrice, StringComparison.OrdinalIgnoreCase)) != null;
            bool isHighestPriceVariantSpecified         = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.HighestPricedVariant, StringComparison.OrdinalIgnoreCase)) != null;

            var uniqueIds             = request.ProductIds.ToList().Distinct();
            var productSearchItemList = this.GetProductsFromIndex(request.ProductCatalogName, uniqueIds);

            foreach (var productSearchItem in productSearchItemList)
            {
                var foundId = uniqueIds.SingleOrDefault(x => x == productSearchItem.Name);
                if (foundId == null)
                {
                    continue;
                }

                if (productSearchItem != null)
                {
                    // SOLR returns 0 and not <null> for missing prices.  We set the prices to null when 0 value is encountered.
                    decimal?listPrice = !productSearchItem.OtherFields.ContainsKey("listprice") ? (decimal?)null : ((decimal)productSearchItem.ListPrice == 0M ? (decimal?)null : (decimal)productSearchItem.ListPrice);
                    decimal?basePrice = !productSearchItem.OtherFields.ContainsKey("baseprice") ? (decimal?)null : ((decimal)productSearchItem.BasePrice == 0M ? (decimal?)null : (decimal)productSearchItem.BasePrice);

                    ExtendedCommercePrice extendedPrice = this.EntityFactory.Create <ExtendedCommercePrice>("Price");

                    // The product base price is the Connect "List" price.
                    if (isList)
                    {
                        if (basePrice.HasValue)
                        {
                            extendedPrice.Amount = basePrice.Value;
                        }
                        else
                        {
                            // No base price is defined, the List price is set to the actual ListPrice define in the catalog
                            extendedPrice.Amount = (listPrice.HasValue) ? listPrice.Value : 0M;
                        }
                    }

                    // The product list price is the Connect "Adjusted" price.
                    if (isAdjusted && listPrice.HasValue)
                    {
                        extendedPrice.ListPrice = listPrice.Value;
                    }

                    var variantInfoString = productSearchItem.VariantInfo;
                    if ((isLowestPriceVariantSpecified || isLowestPriceVariantListPriceSpecified || isHighestPriceVariantSpecified) && !string.IsNullOrWhiteSpace(variantInfoString))
                    {
                        List <VariantIndexInfo> variantIndexInfoList = JsonConvert.DeserializeObject <List <VariantIndexInfo> >(variantInfoString);
                        this.SetVariantPricesFromProductVariants(productSearchItem, variantIndexInfoList, extendedPrice, isLowestPriceVariantSpecified, isLowestPriceVariantListPriceSpecified, isHighestPriceVariantSpecified);
                    }

                    result.Prices.Add(foundId, extendedPrice);
                }
            }
        }
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public override void Process(Commerce.Pipelines.ServicePipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Request, "args.request");
            Assert.ArgumentCondition(args.Request is GetProductBulkPricesRequest, "args.Request", "args.Request is GetProductBulkPricesRequest");
            Assert.ArgumentCondition(args.Result is Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult, "args.Result", "args.Result is GetProductBulkPricesResult");

            GetProductBulkPricesRequest request = (GetProductBulkPricesRequest)args.Request;

            Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult result = (Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult)args.Result;

            Assert.ArgumentNotNull(request.ProductCatalogName, "request.ProductCatalogName");
            Assert.ArgumentNotNull(request.ProductIds, "request.ProductIds");
            Assert.ArgumentNotNull(request.PriceType, "request.PriceType");

            ICatalogRepository catalogRepository = ContextTypeLoader.CreateInstance <ICatalogRepository>();

            bool isList     = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.List, StringComparison.OrdinalIgnoreCase)) != null;
            bool isAdjusted = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.Adjusted, StringComparison.OrdinalIgnoreCase)) != null;
            bool isLowestPriceVariantSpecified          = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.LowestPricedVariant, StringComparison.OrdinalIgnoreCase)) != null;
            bool isLowestPriceVariantListPriceSpecified = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.LowestPricedVariantListPrice, StringComparison.OrdinalIgnoreCase)) != null;
            bool isHighestPriceVariantSpecified         = request.PriceTypeIds.FirstOrDefault(x => x.Equals(PriceTypes.HighestPricedVariant, StringComparison.OrdinalIgnoreCase)) != null;

            var uniqueIds = request.ProductIds.ToList().Distinct();

            foreach (var requestedProductId in uniqueIds)
            {
                try
                {
                    var product = catalogRepository.GetProductReadOnly(request.ProductCatalogName, requestedProductId);

                    ExtendedCommercePrice extendedPrice = this.EntityFactory.Create <ExtendedCommercePrice>("Price");

                    // BasePrice is a List price and ListPrice is Adjusted price
                    if (isList)
                    {
                        if (product.HasProperty("BasePrice") && product["BasePrice"] != null)
                        {
                            extendedPrice.Amount = (product["BasePrice"] as decimal?).Value;
                        }
                        else
                        {
                            // No base price is defined, the List price is set to the actual ListPrice define in the catalog
                            extendedPrice.Amount = product.ListPrice;
                        }
                    }

                    if (isAdjusted && !product.IsListPriceNull())
                    {
                        extendedPrice.ListPrice = product.ListPrice;
                    }

                    if ((isLowestPriceVariantSpecified || isLowestPriceVariantListPriceSpecified || isHighestPriceVariantSpecified) && product is ProductFamily)
                    {
                        this.SetVariantPrices(product as ProductFamily, extendedPrice, isLowestPriceVariantSpecified, isLowestPriceVariantListPriceSpecified, isHighestPriceVariantSpecified);
                    }

                    result.Prices.Add(requestedProductId, extendedPrice);
                }
                catch (EntityDoesNotExistException e)
                {
                    result.Success = false;
                    result.SystemMessages.Add(new SystemMessage {
                        Message = e.Message
                    });
                    continue;
                }
            }
        }
        /// <summary>
        /// Sets the variant prices by looping through all of the variants.
        /// </summary>
        /// <param name="productFamily">The product family.</param>
        /// <param name="extendedPrice">The extended price.</param>
        /// <param name="isLowestPriceVariantSpecified">if set to <c>true</c> the lowest priced variant adjusted price is returned.</param>
        /// <param name="isLowestPriceVariantListPriceSpecified">if set to <c>true</c> the lowest priced variant list price is returned.</param>
        /// <param name="isHighestPriceVariantSpecified">if set to <c>true</c> the highest priced variant adjusted price.</param>
        protected virtual void SetVariantPricesFromProductVariants(ProductFamily productFamily, ExtendedCommercePrice extendedPrice, bool isLowestPriceVariantSpecified, bool isLowestPriceVariantListPriceSpecified, bool isHighestPriceVariantSpecified)
        {
            if (productFamily.Variants != null && productFamily.Variants.Count > 0)
            {
                decimal highestPrice        = 0.0M;
                decimal lowestPrice         = 0.0M;
                decimal basePrice           = 0.0M;
                bool    processingFirstItem = true;

                foreach (Variant variant in productFamily.Variants)
                {
                    if (!variant.IsListPriceNull())
                    {
                        if (processingFirstItem || variant.ListPrice < lowestPrice)
                        {
                            lowestPrice = variant.ListPrice;
                            basePrice   = variant.DataRow.Table.Columns.Contains("BasePriceVariant") && variant.DataRow["BasePriceVariant"] != DBNull.Value ? Convert.ToDecimal(variant.DataRow["BasePriceVariant"], CultureInfo.InvariantCulture) : 0.0M;
                        }

                        if (processingFirstItem || variant.ListPrice > highestPrice)
                        {
                            highestPrice = variant.ListPrice;
                        }

                        processingFirstItem = false;
                    }
                }

                if (isLowestPriceVariantSpecified)
                {
                    extendedPrice.LowestPricedVariant = lowestPrice;
                }

                if (isLowestPriceVariantListPriceSpecified)
                {
                    extendedPrice.LowestPricedVariantListPrice = basePrice;
                }

                if (isHighestPriceVariantSpecified)
                {
                    extendedPrice.HighestPricedVariant = highestPrice;
                }
            }
        }
        /// <summary>
        /// Sets the variant prices from base product.
        /// </summary>
        /// <param name="productFamily">The product family.</param>
        /// <param name="extendedPrice">The extended price.</param>
        /// <param name="isLowestPriceVariantSpecified">if set to <c>true</c> the lowest priced variant adjusted price is returned.</param>
        /// <param name="isLowestPriceVariantListPriceSpecified">if set to <c>true</c> the lowest priced variant list price is returned.</param>
        /// <param name="isHighestPriceVariantSpecified">if set to <c>true</c> the highest priced variant adjusted price.</param>
        protected virtual void SetVariantPricesFromBaseProduct(ProductFamily productFamily, ExtendedCommercePrice extendedPrice, bool isLowestPriceVariantSpecified, bool isLowestPriceVariantListPriceSpecified, bool isHighestPriceVariantSpecified)
        {
            decimal lowestPricedVariantAdjustedPrice;
            decimal lowestPricedVariantListPrice;

            if (productFamily.HasProperty("BasePrice") && productFamily["BasePrice"] != null)
            {
                lowestPricedVariantAdjustedPrice = productFamily.ListPrice;
                lowestPricedVariantListPrice     = (productFamily["BasePrice"] as decimal?).Value;
            }
            else
            {
                // No base price is defined, the List price is set to the actual ListPrice define in the catalog
                lowestPricedVariantAdjustedPrice = productFamily.ListPrice;
                lowestPricedVariantListPrice     = productFamily.ListPrice;
            }

            if (isLowestPriceVariantSpecified)
            {
                extendedPrice.LowestPricedVariant = lowestPricedVariantAdjustedPrice;
            }

            if (isLowestPriceVariantListPriceSpecified)
            {
                extendedPrice.LowestPricedVariantListPrice = lowestPricedVariantListPrice;
            }
        }