Get total items count in cart magento
Here is a simple code to get the items count in cart magento. The below code is return total items count not total quantity counts. For example skuA has 10 qty in cart and skyB has 2 qty in cart then below code return 2 counts becoz there are total 2 products/items in cart.
<?php
$totalItems = Mage::helper('checkout/cart')->getItemsCount();
echo $totalItems;
?>