Ubercart: How to update a variable on payment received or status completed

1

Ubercart: How to update a variable on payment received or status completed

 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?

Created by sudeepg 20 weeks 2 days ago – Made popular 20 weeks 2 days ago
Category:   Tags:

Answers to the above Question:

0

Hook_order is the solution

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>

Read »
Created by HadaclEaf 20 weeks 2 days ago
Category:   Tags: