0

I'm looking at the Drupal Commerce module in Drupal 7, and it has a Rule to send an email notification that the order was completed after checkout. Perusing the code in commerce_checkout.rules.inc, the hook_rules_event_info() has a variable of type commerce_order().

How does Rules retrieve the tokens and the $order object? Or how does the Commerce Order module define a variable type to use with Rules?

1 Answer 1

1

I was looking in the wrong place and thought about how Rules work the wrong way. The event for when an Order entity is part of the Rule is triggered by the Commerce module on checkout.

rules_invoke_all('commerce_checkout_complete', $order); 

And for the other entities, Rules already takes care of most by invoking events from its events.inc.

1
  • Exactly. And the tokens come from commerce_order.tokens.inc Commented Sep 8, 2011 at 22:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.