ubercart: finding order id when admin is editing order I have a custom shipping quote module which adds freight costs to the orders admin comments:   

$order_id = intval($_SESSION['cart_order']);
uc_order_comment_save($order_id, 0, t($shippingquote_text), 'admin');


This works correctly when the user goes through the checkout process. 

Problem:
How do i find the order id when the admin is manually editing a users order?

For example: admin is on admin/store/orders/3845/edit and clicks get shipping quote button - which fires freight quote module

Want:
comment is saved to order 3845 w shipping quote details. 

My answer below is valid for Ubercart 7.36 as the page doesn't use Ajax.
UberCart 7.38 Uses Ajax, and the same variable isn't available. Still looking for an answer
I found the answer after posting the question:  (Valid for Ubercart 7.36)

if (in_array('administrator', $user-&gt;roles)) {
dpm (" do fancy stuff");
dpm($_SESSION['ucga_order_id']);

$order_id = $_SESSION['ucga_order_id'];
 uc_order_comment_save($order_id, 0, t($admin_text), 'admin');

dpm ("end admin fancy");

}