Magento 2 How to interchange positions of block-search and mini-cart in front-end.
2 Answers
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
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