I’m looking to move the cart_sidebar up into top.phtml, It’s a rather simple move that i’ve done several times, however I am having 0 luck doing it now that I’m running Magento 1.5.1.
did they change something significant?
see code being used below.
checkout.xml
<reference name="mini_cart_top">
<block type="checkout/cart_sidebar" name="mini_cart_top" template="checkout/cart/sidebar.phtml"/>
</reference>
page.xml
<block type="page/html_header" name="header" as="header">
<block type="checkout/cart_sidebar" name="mini_cart_top" as="mini_cart_top" template="checkout/cart/sidebar.phtml"/>
other misc code...
top.phtml
<?php echo $this->getChildHtml('mini_cart_top'); ?>
any help would be greatly appreciated!
catalog.xml
<reference name="top.menu">
<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
<block type="checkout/cart_sidebar" name="mini_cart_top" as="mini_cart_top" template="checkout/cart/sidebar.phtml"/>
</reference>
I’ve moved this successfully in 1.5
You’ve put the cart_sidebar XML block into the header block which would allow you to use it in header.phtml, not in top.phtml.
top.phtml is a similar block to sidebar.phtml – it should only really contain the categories navigation, not the shopping cart.
If you can clarify where you want to put it and why, I’ll tell you how to get it working.