Display Cart Summary and GrandTotal In Magento
Sometime we need to display cart quantity and grand total on our website with the code below
we can easily display cart summary and cart grand total anywhere on site.
[php]
<?php
$QtyCount = $this->helper(‘checkout/cart’)->getSummaryCount();
$CartTotal = $this->helper(‘checkout/cart’)->getQuote()->getGrandTotal();
if($QtyCount==0)
{
echo $this->__(‘Items: %s’,$QtyCount);
}
if($QtyCount==1)
{
echo $this->__(‘ Item: %s’,$QtyCount);
}
if($count>1)
{
echo $this->__(‘ Items: %s’,$count);
}
echo $this->__(‘ Total: %s’, $this->helper(‘core’)->formatPrice($CartTotal, false));
?>
[/php]