Is your feature request related to a problem? Please describe.
Requirement: a promotion like "for every N of Product A, add free gift B"
Currently this is not possible because the value of N (which would be calculated by the PromotionCondition and passed as state to the PromotionAction) is not available in the side-effect API methods onActivate and onDeactivate. Thus there is no way to know how many free gifts to add.
Describe the solution you'd like
Add a state arg to those functions, passing in the data object from the dependent promo condition(s).
Describe alternatives you've considered
Re-implement the logic in the action to calculate the number to add, but this is bad for efficiency and maintenance.
Is your feature request related to a problem? Please describe.
Requirement: a promotion like "for every N of Product A, add free gift B"
Currently this is not possible because the value of N (which would be calculated by the PromotionCondition and passed as state to the PromotionAction) is not available in the side-effect API methods
onActivateandonDeactivate. Thus there is no way to know how many free gifts to add.Describe the solution you'd like
Add a
statearg to those functions, passing in the data object from the dependent promo condition(s).Describe alternatives you've considered
Re-implement the logic in the action to calculate the number to add, but this is bad for efficiency and maintenance.