I have ubercart 2 installed and I want to update a variable once the order has been paid (this means the order status is changed to complete or payment received. What is the best way of doing that in the code? What hook?
I have ubercart 2 installed and I want to update a variable once the order has been paid (this means the order status is changed to complete or payment received. What is the best way of doing that in the code? What hook?
You are looking for following piece of code for sure:
<php>
function hook_order($op, $order, $status) {
switch ($op) {
case 'update':
if (($order->uid > 0) && ($order_user = user_load(array('uid' => $order->uid))) !== FALSE && ($status == 'completed' || $status == 'payment_received')) {
// your code here
break;
}
}
}
</php>
Post your Answer