How to Move Cart into Navigation Instead of Header in Magento 1.9

cartmagento-1.9rwd-theme

No one seems to have the answer to this. I literally just want to move my cart from the default header position in the RWD theme into my navigation instead. How can this be done? thank you

Best Answer

You will need to do a bit of restyling with CSS and possibly make HTML changes to the cart template but here is how you can move the cart to the end of the navigation in Magento RWD theme.

In your theme's layout file add the following:

<default>
    <reference name="header">
        <action method="unsetChild">
            <name>minicart_head</name>
        </action>
    </reference>
    <reference name="catalog.topnav">
        <action method="insert">
            <name>minicart_head</name>
        </action>
    </reference>
</default>

This will move the block from the header block into the navigation block. You then need to copy the template "page/html/topmenu.phtml" into your theme and output the "minicart_head" child block within an li.

<?php $_menu = $this->getHtml('level-top') ?>

<?php if($_menu): ?>
    <nav id="nav">
        <ol class="nav-primary">
            <?php echo $_menu ?>
            <li class="header-minicart">
                <?php echo $this->getChildHtml('minicart_head'); ?>
            </li>
        </ol>
    </nav>
<?php endif ?>

See below screenshot of it working in RWD. As mentioned you will need to make some CSS changes.

enter image description here

Related Topic