How to get Total Cart Item and total Price in magento
<?php
$count = $this->helper('checkout/cart')->getSummaryCount(); //get total items in cart
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
for more magento tutorial visit: <a title="http://blog.free-extension.com" href="http://blog.free-extension.com">http://blog.free-extension.com/</a>
?>
for more magento tutorial visit: http://blog.free-extension.com/
Thanks for this code, works perfectly! I needed it for a custom made overview.