I need to call a function upon successful completion of an order, and that function needs to know the OrderID that called it.
I have setup a rule
Event: "Completing the checkout process"
Actions: [custom function]
I am aware of two possible ways pass the order_id.
- Using a data selector (though I'm not exactly sure what this should be), and passing it through a 'value' argument -or-
- Calling the function commerce_cart_order_id($uid) from within my function.
commerce_cart_order_id($uid) did not seem to return anything.
global $user; $uid = $user->uid; $order_id = commerce_cart_order_id($uid); drupal_set_message(t('OrderID: ' . $order_id), 'status');
Has anyone got any suggestions on what I might be doing wrong? Many thanks.