Magento 2 How to interchange positions of block-search and mini-cart in front-end.

2 Answers 2


if you are using custom theme then try changing below file


<move element="minicart" destination="header-wrapper" after="top.search"/>


<move element="top.search" destination="header-wrapper" after="minicart"/>

You can put this line anywhere inside body tag.After changing file flush the magento cache


You should use a custom theme. There in your theme create a file called default.xml under YOURTHEME/Magento_Theme/layout/ and then edit it like this

<?xml version="1.0"?>
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <move element="minicart" destination="header-wrapper" after="top.search"/>

Remember to flush cache, bin/magento cache:flush

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.