How to access the order total amount in Drupal commerce?
Try this

global $user;
$image = theme('image', array('path' =&gt; url('sites/default/files/basketempty.png', array('absolute' =&gt; TRUE))));
$order = commerce_cart_order_load($user-&gt;uid);

if ($order) {
  $wrapper = entity_metadata_wrapper('commerce_order', $order);
  $line_items = $wrapper-&gt;commerce_line_items;
  $total = commerce_line_items_total($line_items);
  if($total['amount']){ 
    $image = theme('image', array('path' =&gt; url('sites/default/files/basketfull.png', array('absolute' =&gt; TRUE))));
  }
}

echo l($image, 'twotrees/cart', array('html' =&gt; TRUE));