I am using Magento eCommerce and I have modified my header.phtml via the Blank template. Code, this is my code but it shows blank.
Use the helper object to get the current cart object, and then count the number of items in the cart object.
echo Mage::helper('checkout/cart')->getCart()->getItemsCount();
More from http://www.douglasradburn.co.uk/how-to-get-number-of-cart-items-in-magento/