How is one supposed to implement a "Product discount by amount" type of campaign and have it properly work with the "MaxDiscountsOnItemInOrder" property without having to split order rows?

I have had a look at how OrderRowCarrier.DiscountAmount is calculated. It is calculated by multiplying OrderRowCarrier.DiscountPercentage with quantity + either unit list price or unit campaign price. This means that OrderRowCarrier.DiscountPercentage and OrderRowCarrier.DiscountAmount come together. They are used in combination and they make sense for campaign discounts of type “Product discount by percentage”. But when the campaign is of type “Product discount by amount” then one cannot set OrderRowCarrier.DiscountAmount as it will be overwritten in OrderTotalCalculator.CalculateOrderRowTotal unless one has also set OrderRowCarrier.DiscountPercentage which doesn’t make sense for an amount discount on product.

To get a “Product discount by amount” campaign to work one can set the unit campaign price but this gives another issue. If you utilize the “MaxDiscountsOnItemInOrder” on the campaign to say that the campaign can only be applied once to a product that is included in the campaign then one has to split the order row into two if you have quantity > 1. For example if product X has quantity 3 in your only order row on your order and a product discount by amount campaign kicks in with MaxDiscountsOnItemInOrder = 1 then your only order row will have to be split into two. One with the number of pieces that are allowed to get the campaign discount as we must set Unit Campaign price correctly per piece. The other row will then have the rest of the quantity from the original order row without a unit campaign price set. This works of course but for an end-user it doesn’t make sense that your single order row got split into two.

So what is the idea in Litium for implementation of “Product discount by amount” type of campaigns with “MaxDiscountsOnItemInOrder” set?

Litium version: 7.1

Option 1: Add as a unit campaign price. Unit price - product discount by amount = Unit Campaign price
Option 2: Add the total discount as a order level discount.