Display Cart Quantity & Total price In MAgento Top Menu
<?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->__(‘<a href=”/checkout/cart” >(0 ITEMS)</a>’,$count);
}
if($count==1)
{
echo $this->__(‘<a href=”/checkout/cart” >(1 ITEM)</a>’,$count);
}
if($count>1)
{
echo $this->__(‘<a href=”/checkout/cart” >(%s ITMES)</a>’,$count);
}
echo $this->__(‘Total: %s’, $this->helper(‘core’)->formatPrice($total, false));
?>
0