Skip to content

"State" is not passed to promotion action onActivate function #2944

Description

@michaelbromley

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions