Magento: How to move cart block from sidebar to header?
Posted by admin in Magento
Open file: /app/design/frontend/your_theme/your_theme/template/page/html/header.phtml and add this line where you want the cart block to be displayed:
<?php echo $this->getChildHtml(’cart_sidebar_head’) ?>
Open file: /app/design/frontend/your_theme/your_theme/layout/page.xml and insert this in block type page/html_header:
<block type=”checkout/cart_sidebar” name=”cart_sidebar_head” template=”checkout/cart/sidebar.phtml” />
You probably don’t need cart block in you sidebar anymore so open file: /app/design/frontend/your_theme/your_theme/layout/checkout.xml and remove or comment these lines:
<block type=”checkout/cart_sidebar” name=”cart_sidebar” template=”checkout/cart/sidebar.phtml” before=”-”>
<action method=”addItemRender”><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method=”addItemRender”><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method=”addItemRender”><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</block>



hi, i tried it but nothing appears. maybe because i have my own template? thanks
You put this code in your template files. You have to replace all the ” with normal ones, I have some problems displaying ” on my blog…sorry…