Hi everyone,

I've got a strange issue with the shopping cart summary in my header.

Whenever there is nothing in the cart and the cart counter is at "0", it sometimes disappears when navigating to a page for the first time. When the user refreshes the page, it then reappears. It creates a horizontal scrollbar which stretches the page about 400px to the right.

This is the code for the cart summary from tpl_shopping_cart_header.php which is called from the header:


<?php

$content = "";
$product_amount = 0;

if ($_SESSION['cart']->count_contents() > 0) {
$products = $_SESSION['cart']->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$product_amount = $products[$i]['quantity'] + $product_amount;
}

$content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '"><img class="cart-icon full" src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" />' . HEADER_PRODUCT_AMOUNT . '<div id="cartquantity">'. $product_amount . '</div></a> ';
} else {
$content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '"><img class="cart-icon empty" src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" />' . HEADER_PRODUCT_AMOUNT . '<div id="cartquantity">'. $product_amount . '</div></a> ';
}
if ($_SESSION['cart']->count_contents() > -1) {
$content .= HEADER_CART_SUBTOTAL .'<div id="carttotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
}

?>




and the code from the header is..

<?php require($template->get_template_dir('tpl_shopping_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_header.php');
echo $content;
/*require($template->get_template_dir('tpl_box_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_header.php');*/?>



If someone could help I'd really appreciate it, as this is doing my head in!

Site url is - http://notoriousdesign.co.uk/dr.um

Thank you!