Drupal Commerce: Alter 'Checkout' link in user menu
Use this function in your custom module to return a bool for determining if there items in the basket/cart.

function items_on_cart(){
global $user;
$cart = commerce_cart_order_load($user-&gt;uid);
$line_items = count($cart-&gt;commerce_line_items) ? true : false;
return $line_items;
}


Then in your theme template do the following...

function YOURTHEME_menu_link(array $variables) {

    $element = $variables['element'];
    $sub_menu = '';
    $name_id = strtolower(strip_tags($element['#title']));  

    // add class to checkout link if basket active
    if ($name_id == 'checkout') {
        if (YOURMODULE_items_on_cart()) {
          $element['#localized_options']['attributes']['class'][] = 'active';
        }
    }