1

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

2 Answers 2

1

if you are using custom theme then try changing below file

app/design/frontend/Your_vendor/Theme_name/Magento_Theme/layout/default.xml

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

OR

<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

1

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">
 <body>
   <move element="minicart" destination="header-wrapper" after="top.search"/>
 </body>
</page>

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.