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
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.
-
Yep , I tried the same thing but the functionality is still working Commented Nov 27, 2015 at 8:08
-
Copy below file in your theme directory
app/design/frontend/base/default/layout/catalogsearch.xmlsearch the layout catalogsearch_advanced_index & Just comment out the code inside that tag to hide the advance search content.