what is the hook when a commerce order is updated? I am searching for a hook name when a commerce order is updated ?

Indeed I have programmed a module that it must perform some operations when a commerce order is modified. for example when order status is changed or when a line item in selected order is changed.

do you know what is the hook name when a commerce order is modified ?
The documentation for commerce_order_status_update() says:


  While there is no explicit Rules event or hook devoted to an order
  status being updated...


It is possible to use hook_commerce_order_presave():

/**
 * Implements hook_commerce_order_presave().
 */
function my_module_commerce_order_presave($order) {
  if ($order-&gt;status != $order-&gt;original-&gt;status) {
    drupal_set_message("The order status changed from {$order-&gt;original-&gt;status} to {$order-&gt;status}");
  }
}


Here's an optional helper function for use elsewhere if you have an $order object, and are curious if its status has changed from what is stored in the database:

/**
 * Given an order object, this returns FALSE if the order status has not
 * changed. If it has changed, it returns an associative array with the
 * following keys: new_order_status, old_order_status
 */
function my_module_order_status_changed($order) {
  $result['new_order_status'] = $order-&gt;status;
  $result['old_order_status'] = db_select('commerce_order', 'co')
    -&gt;fields('co', array('status'))
    -&gt;condition('co.order_id', $order-&gt;order_id)
    -&gt;execute()
    -&gt;fetchField();
  if ($result['new_order_status'] == $result['old_order_status']) {
    return FALSE;
  }
  return $result;
}