PriceCalculationService.cs
I want to change two conditions
Old code
foreach (var discount in product.AppliedDiscounts)
{
if (_discountService.ValidateDiscount(discount, customer).IsValid &&
discount.DiscountType == DiscountType.AssignedToSkus)
allowedDiscounts.Add(_discountService.MapDiscount(discount));
}
new code
foreach (var discount in product.AppliedDiscounts)
{
if (discount.DiscountType == DiscountType.AssignedToSkus && _discountService.ValidateDiscount(discount, customer).IsValid)
allowedDiscounts.Add(_discountService.MapDiscount(discount));
}
and for category and manufacturer (two places)
old code
if (_discountService.ValidateDiscount(discount, customer).IsValid &&
!_discountService.ContainsDiscount(allowedDiscounts, discount))
allowedDiscounts.Add(discount);
new code
if (!_discountService.ContainsDiscount(allowedDiscounts, discount) && _discountService.ValidateDiscount(discount, customer).IsValid)
allowedDiscounts.Add(discount);