Showing magento cart items quantity on header

Showing magento cart items quantity and price on header

Sometimes in magento our client want magento cart items quantity and price on header. Recently I have experienced it and solve it. Now you can easily do this just following the below step:


First step:

To do this, first you need to edit  header.phtml which is located on


If it not located there, then you can find it on this following location:


Now paste the below code where you need to show the magento cart items quantity and price.

    $count = $this->helper('checkout/cart')->getSummaryCount();  //get total
            echo $this->__('<div><div></div><p><span>0</span> items</p></div>',$count);
        echo $this->__('<div><div></div><a href="/checkout/cart"><p><span>1</span> item</p></a></div>',$count);
        echo $this->__('<a href="/checkout/cart"><div><div></div><a href="/checkout/cart"><p><span>%s</span> items</p></a></div>',$count);
        <strong><?php echo Mage::helper('checkout')->formatPrice(Mage::getModel('checkout/session')->getQuote()->getGrandTotal()) ?></strong>

Now check your site header, the magento cart items quantity and price are showing. Then apply CSS and give the look as you want.

Published by

Salim Sazzad

Hi, I am Salim Sazzad. I am a web developer. I always try to share my experience with others. Please freely contact me if i made any kind of mistakes. I think that will help me and others. Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>