Magento-Display Shopping Cart in Header

Go to app\design\frontend\base\default\template\page\html\header.phtml
Add the following code inside the header-container div to display total number of  items and price in header .

  $count = $this->helper('checkout/cart')->getSummaryCount();  //get total
  $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
    echo $this->__('Items: %s',$count);
    echo $this->__(' Item: %s',$count);
    echo $this->__(' Items: %s',$count);
  echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));

For Magento 1.4

6 thoughts on “Magento-Display Shopping Cart in Header

  1. This is exactly what I was looking for…have been trying to get it to work perfectly for days. This really worked like a charm – thanks heaps!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s