Discounts - Cumulative with other discounts

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Good day!
I have 2 discount in setup:
1. Assigned to products - with no requirement and cumulative with other discounts = False.
2. Assigned to Order total with requirement by order sum with cumulative with other discounts = False.
But in result i see that both discounts applyed to shopping cart.
My question is why and what is the purpose of setup cumulative with other discounts.


Some code:
OrderTotalCalculationService

protected virtual decimal GetOrderTotalDiscount(Customer customer, decimal orderTotal, out List<DiscountForCaching> appliedDiscounts)
        {
            appliedDiscounts = new List<DiscountForCaching>();
            decimal discountAmount = decimal.Zero;
            if (_catalogSettings.IgnoreDiscounts)
                return discountAmount;

            var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToOrderTotal);
            //TODO:: I think some path of logic missing there?????

            //TODO::

            var allowedDiscounts = new List<DiscountForCaching>();
            if (allDiscounts != null)
                foreach (var discount in allDiscounts)
                    if (_discountService.ValidateDiscount(discount, customer).IsValid &&
                        !allowedDiscounts.ContainsDiscount(discount))
                    {
                        allowedDiscounts.Add(discount);
                    }

            appliedDiscounts = allowedDiscounts.GetPreferredDiscount(orderTotal, out discountAmount);

            if (discountAmount < decimal.Zero)
                discountAmount = decimal.Zero;

            if (_shoppingCartSettings.RoundPricesDuringCalculation)
                discountAmount = RoundingHelper.RoundPrice(discountAmount);

            return discountAmount;
        }

6 years ago
Could u explain why there is no checking like this:

            var discountForProducts = _discountService.GetAllDiscountsForCaching().Where(p => !p.IsCumulative == true &&
                                                                                        (p.DiscountType == DiscountType.AssignedToSKUProductTuple
                                                                                        || p.DiscountType == DiscountType.AssignedToSkus));


6 years ago
art_MOO wrote:
Good day!
I have 2 discount in setup:
1. Assigned to products - with no requirement and cumulative with other discounts = False.
2. Assigned to Order total with requirement by order sum with cumulative with other discounts = False.
But in result i see that both discounts applyed to shopping cart.
My question is why and what is the purpose of setup cumulative with other discounts.


The setting of Cumulative with Other Discounts applies only to discounts of the same type. In your case they are of different type, thus the restriction does not apply. Please check this video
4 years ago
Tecnofin wrote:
Good day!
I have 2 discount in setup:
1. Assigned to products - with no requirement and cumulative with other discounts = False.
2. Assigned to Order total with requirement by order sum with cumulative with other discounts = False.
But in result i see that both discounts applyed to shopping cart.
My question is why and what is the purpose of setup cumulative with other discounts.


The setting of Cumulative with Other Discounts applies only to discounts of the same type. In your case they are of different type, thus the restriction does not apply. Please check this video


Is there any way not to cumulative discounts in that situation? In different type of discounts
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.