Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Fix for pricing calculation for Bundle product types when product attributes are configured (#239)
Nikhil Scariaef9cd8e55e8a
diff --git a/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs b/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.csindex 846f95272..f6ee5a1eb 100644--- a/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs+++ b/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs@@ -619,28 +619,25 @@ namespace Grand.Business.Catalog.Services.Pricesdouble attributesTotalPrice = 0;if (attributes != null && attributes.Any()){- if (product.ProductTypeId != ProductType.BundledProduct)+ var attributeValues = _productAttributeParser.ParseProductAttributeValues(product, attributes);+ if (attributeValues != null){- var attributeValues = _productAttributeParser.ParseProductAttributeValues(product, attributes);- if (attributeValues != null)+ foreach (var attributeValue in attributeValues){- foreach (var attributeValue in attributeValues)- {- attributesTotalPrice += await GetProductAttributeValuePriceAdjustment(attributeValue);- }+ attributesTotalPrice += await GetProductAttributeValuePriceAdjustment(attributeValue);}}- else+ if (product.ProductTypeId == ProductType.BundledProduct){foreach (var item in product.BundleProducts){var p1 = await _productService.GetProductById(item.ProductId);if (p1 != null){- var attributeValues = _productAttributeParser.ParseProductAttributeValues(p1, attributes);- if (attributeValues != null)+ var bundledProductsAttributeValues = _productAttributeParser.ParseProductAttributeValues(p1, attributes);+ if (bundledProductsAttributeValues != null){- foreach (var attributeValue in attributeValues)+ foreach (var attributeValue in bundledProductsAttributeValues){attributesTotalPrice += (item.Quantity * await GetProductAttributeValuePriceAdjustment(attributeValue));}