cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop form-mini.js from loading on pages?

How to stop form-mini.js from loading on pages?

I have a fully custom search done by myself, so I want to get rid of form-mini.js since its causing issues with my own version of search.

The problem is, I cant seem to override it, or remove it via <remove>.

 

Any ideas?

1 REPLY 1

Re: How to stop form-mini.js from loading on pages?

Hello @blaz_p

 

magento 2 intilize js using data-mage-init

 

if you see quick search input type 

<input id="search"
                           data-mage-init='{"quickSearch":{
                                "formSelector":"#search_mini_form",
                                "url":"http://magento2-demo.nexcess.net/search/ajax/suggest/",
                                "destinationSelector":"#search_autocomplete"}
                           }'

using 

 data-mage-init

it is calling 

var config = {
    map: {
        '*': {
            quickSearch: 'Magento_Search/form-mini'
        }
    }
};

based on requirejs-config.js 

 

so you need to remove 

data-mage-init='{"quickSearch":{
                                "formSelector":"#search_mini_form",
                                "url":"http://magento2-demo.nexcess.net/search/ajax/suggest/",
                                "destinationSelector":"#search_autocomplete"}
                           }'


Hope it will help you.

 

if work then mark as solution.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer