I’m having trouble in moving the mini cart from sidebar to header. I’ve tried all the tutorials available in the internet but it doesn’t work.

I also tried adding this in the header block of layout\page.xml

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

And then in my page\html\header.phtml, I use the code below to call the cart but nothing happened.

<?php echo $this->getChildHtml('topcart'); ?>

The solution above works in magento 1.6, but not in version 1.7

Thanks in advance guys


2 Answers 2


In Local.xml add this :

<reference name="header">
            <!-- add cart to header -->
            <block type="checkout/cart_sidebar" name="header-cart" template="checkout/cart/header-cart.phtml">
                <action method="addItemRender"><type>simple</type>
                <action method="addItemRender"><type>grouped</type>
                <action method="addItemRender"><type>configurable</type>
                <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
                    <label>Shopping Cart Sidebar Extra Actions</label>

In header.phtml add this :

<?php echo $this->getChildHtml('header-cart'); ?>

Please see post:

Move Cart to Header In Magento 1.8.1

" (1) In yourTheme/template/page/html/header.phtml:

//Place following code where you want Cart to show:
<?php echo $this->getChildHtml('cart_sidebar'); ?>

" "Please copy and paste base/default/layout/checkout.xml into YOURTHEME/layout. Then rename

<reference name="right"> 
<reference name="header">"

"Normaly the cart is not in right column anymore. Also the cart should appear in the header if you still have getChildHtml('cart_sidebar'); ?> in header.phtml"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.