The code has to be rewriteen as follows:
if (is_object($cart)) {
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);
}
if (sizeof($products) > 0) {
$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));
$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));
} else {
$contents[] = array('text' => ' ');
}
}
good luck!