Moving Magento mini-cart To Header

Moving Mini-cart to header in magento is really simple you just need to change your xml and place the magento getChildHtml() function in header section and you are done with it. below are steps by which we can move mini cart.

Step1. Open checkout.xml from location given below


find the code below in file.

<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"/>

Step2. now open page.xml can be found at location given below


in this file find the code given below

<block type="page/html_header" name="header" as="header">

paste the the cart_sidebar block as shown below.

<block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu"/>

<!--new added block -->
<block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>


clear your var/cache folder and check you are done

Leave a Reply

Your email address will not be published.

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>