Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

How to Move sidebar cart To Header Magento

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

Step1. Open checkout.xml from location given below

/design/frontend/default/[your theme]/layout/checkout.xml

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

\design\frontend\default\[your theme]\layout\page.xml

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" translate="label">
    <label>Navigation Bar</label>

    <!--new added block -->
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"/>
    <!--end new block -->
    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>

Clear your cache.
Thats its............

Hit like or leave comment if post help!

Please support us, Like us on Facebook.

  1. Thanks a lot. This is the easiest solution I found after a lot of googling. :)

    ReplyDelete

 

Copyright @ 2017 HKBlog.