I have moved the mini cart before top.search using below code in my theme under
app/design/frontend/Mytheme/luma_child/Magento_Checkout/layout/default.xml
<?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>
<referenceContainer name="header-wrapper">
<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="top.search" template="Magento_Checkout::cart/minicart.phtml">
-------rest of the code ---------
</referenceContainer>
</body>
</page>
This code moves minicart before top.search successfully but it is breaking the minicart item rendering block
giving error in console like below
Uncaught TypeError: Unable to process binding "if: function(){return
getCartParam('summary_count') }"
Message: Unable to process binding "foreach: function(){return {
data:getCartItems(),as:'item'} }"
Message: Unable to process binding "foreach: function(){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Message: Cannot read property 'simple' of undefined
at UiClass.getItemRenderer (minicart.js:138)
at foreach (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:93)
at knockout.js:3889
at Object.init (knockout.js:5023)
at init (knockout.js:3914)
at knockout.js:2989
at Object.ignore (knockout.js:1249)
at knockout.js:2988
at Object.arrayForEach (knockout.js:151)
at applyBindingsToNodeInternal (knockout.js:2974)
Can anyone suggest how to move it properly? Or do I need to make any adjustment in minicart.js?