0

I am working on a Magento e-commerce site.
I need to disable the Catalog Advanced Search.
I checked with source code available in the stackexchange but its not working.

2 Answers 2

2

To remove the link to advanced search edit app/design/frontend/{package}/{theme}/layout/catalogsearch.xml.
If the file does not exist in your theme, copy it from base/default. Then remove this from the file:

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

But this will still leave your controller active, and anyone with a link can access it.
To restrict this, create an observer for the events controller_action_predispatch_catalogsearch_advanced_index and controller_action_predispatch_catalogsearch_advanced_result with this code:

public function restrictAccess($observer)
{
    $url = Mage::getUrl('no-route');
    Mage::app()->getResponse()->setRedirect($url);
    Mage::app()->getResponse()->sendResponse();
}

This will redirect the users to a 404 page when trying to access the advanced search form or result page.

2
  • Yep , I tried the same thing but the functionality is still working Commented Nov 27, 2015 at 8:08
  • make sure your observer is called.
    – Marius
    Commented Nov 27, 2015 at 8:15
0
  1. Copy below file in your theme directory
    app/design/frontend/base/default/layout/catalogsearch.xml

  2. search the layout catalogsearch_advanced_index & Just comment out the code inside that tag to hide the advance search content.

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.