Background
I have a function-controlled auto discount, handling both order and product based discount. Recently it failed to combine with discount codes, due to the auto discount being treated as order discount class even when no order discount is being issued.
Therefore want to confirm if the discount class of a function-controlled auto discount, is controlled by “whether orderDiscountsAdd object is presented”, or “whether an actual candidate is included in candidates”?
Case
Discount code
- order discount
- set to allow combineWith product discounts
Auto discount
- set to allow combineWith product and order discounts
- orderDiscountsAdd: empty candidates, selectionStrategy = Maximum
- productDiscountsAdd: have value for candidates
Based on Discount API doc, this auto discount should be treated as product discount class, thus allowing the combination.
Discount classes are assigned based on their associated Discount Function targets:
OrderDiscountCandidateTarget,ProductDiscountCandidateTarget, andDeliveryDiscountCandidateTarget.
In actual use case, this auto discount is also treated a order discount class, which is not expected. This is confirmed by allowing order combineWith in discount code, the two discount successfully combine.
The combination was working until last week, so may I know if the logic regarding discount classes was updated since then?
Thanks in advance.