Drupal Commerce: Alter 'Checkout' link in user menu How do you hook into the 'checkout' link in the user menu?

If there is an item in the basket, want to be able to add a class to the 'checkout' link.

Ideally from the theme template and not hacking the core.
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';
        }
    }