How to retrieve the order id of an order in drupal commerce? Is there a way to do it from the tpl?

ie: page--admin--commerce--orders.tpl.php

I've tried this, but naturally, I get an undefined $order_id variable

if (commerce_order_load($order_id)) {
  echo $order-&gt;uid;
}
If you're looking for the order ID related to the current cart you can use commerce_cart_order_id():

$order = commerce_order_load(commerce_cart_order_id());


But you shouldn't use it directly in a template file. Use a preprocess hook instead, it's better all round.