3

I have installed a third party search mod and now want to remove the native "advanced search" from the web site as well as all reference on the front end.

Have tried the "How to disable Advanced Search?" but that is just a redirect solution and leaves the front end button in the template. How do i do this without endangering future upgrades

3 Answers 3

3

What you want to accomplish is a pretty simple decision tree (though this decision tree is not universal for all modules). When you want to do this for any module, you must look at the theme and the functionality.

  1. Disabling a module. The first decision is whether or not you can disable CatalogSearch entirely. As Rajeev noted, you cannot do this if anything depends on this module. (Spoiler: it's pretty risky to disable core modules, as there are a number of hidden dependencies.)
  2. Removing theme content. As noted in the solution to the "How to disable Advanced Search?" question you can use layout XML to remove the footer link which is added via layout update:

    <layout>
      <default>
        <reference name="footer_links">
          <!-- Remove 'Advanced Search' -->
          <action method="removeLinkByUrl">
            <url helper="catalogsearch/getAdvancedSearchUrl" />
          </action>
        </reference>
      </default>
    </layout>
    

    You will also need to see if there are other links elsewhere (sitemap, etc.) and handle appropriately.

  3. Then you must decide if it's enough to just hide the links to the functionality or if you truly want to remove access. In the latter case, you must remove access to any target URLs, or better yet map them to the new functionality if possible. Of course, you must ensure that the new extension does not rely on the existing routes (based on your question, I'll assume it doesn't). You can choose:
    • Server-based rewrites
    • Magento-based rewrites
    • Event observer
    • And at least a couple other options.
1

The "advanced search" link is added by catalogsearch.xml with this layout update:

<default>
    <reference name="footer_links">
        <action method="addLink" translate="label title" module="catalogsearch">
            <label>Advanced Search</label>
            <url helper="catalogsearch/getAdvancedSearchUrl" />
            <title>Advanced Search</title>
        </action>
    </reference>
</default>

You can remove it in your theme with the following layout update:

<default>
    <reference name="footer_links">
        <action method="removeLinkByUrl">
            <url helper="catalogsearch/getAdvancedSearchUrl" />
        </action>
    </reference>
</default>

Update: I followed your link and found that it suggested the exact same solution. If that does not remove the link for you, you are probably using a theme where the link is placed somewhere else. Search for "getAdvancedSearchUrl" in your code base to find out, where.

1

If you don't want the default catalog search module, then the best way would be disable that module. For this go to System > Configuration > Advanced. This page will show all the activated modules there. You need to disable the module Mage_CatalogSearch module. When you need, you can also enable it through this place. That's it.

But before disabling that module, you need to ensure that, the external plugin that you are relying on does not inherits from default catalogsearch module(Mage_CatalogSearch).

EDIT

As Benmarks pointed out in the comment, if you really want to completely disable default search, then what you need to do is,

  1. Go and find app\etc\modules\Mage_All.xml

  2. Find this section

    <Mage_CatalogSearch>
        <active>true</active>
        <codePool>core</codePool>
        <depends>
            <Mage_Catalog/>
        </depends>
    </Mage_CatalogSearch>
    
  3. Put false inside <active /> node.

Now clear your cache and then you are good to go.

2
  • 3
    System > Configuration > Advanced > Disable Module Output does not disable the module. It merely prevents blocks belonging to that module from rendering anything other than an empty string. The full block lifecycle up through rendering is triggered. In the case that the <layout> node includes a module attribute, layout updates may also be ignored (not the case for CatalogSearch).
    – benmarks
    Sep 28, 2015 at 8:58
  • @benmarks I have updated my answer. Thanks for the head-up. Much appreciated. Sep 30, 2015 at 1:58

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.