I noticed while doing some testing that the actions for applying discounts to orders are available for any predicate whose trigger provides the arguments needed by the discount actions. My assumption here is that the discount won't actually be applied, so correct me if I'm wrong. These actions should be altered out of the form or made inapplicable somehow so users don't try to add them in incorrect places and wonder why their discounts aren't working.

Comments

joachim’s picture

CA determines which actions are available to a trigger based on the entities the action declares it needs in hook_ca_action, and the entities the trigger has to supply as arguments.
So currently, if a discount action says 'I need a node' a trigger has a node to supply, then the action is listed as available to the trigger.

Using hook_form_alter seems like a hacky fix to me.
Could CA hooks for actions and triggers define extra data for this sort of thing?