Magento

Fix Broken Magento Catalog Search Function

We’ve encountered situations where the Magento catalog search function has stopping working for no apparent reason in versions from 1.4.x to 1.7.x. The below details a potential fix that we’ve had success with.

Please note that you should not edit the core file, but create a copy in your local directory so it is not overwritten during future updates.

1) Copy app/code/core/Mage/CatalogSearch/Block/Result.php

2) Uncomment lines 149 and 150

$this->getListBlock()
->setCollection($this->_getProductCollection());

3) Modify line 172 by changing the below:

$this->_productCollection = $this->getListBlock()->getLoadedProductCollection();

to:

$this->_productCollection = Mage::getSingleton('catalogsearch/layer')->getProductCollection();

4) Once the code has been updated, log into the Admin panel and go to System > Index Management. Select all the Indexes, selected the Reindex data action and Submit.

This will hopefully solve any search issues that you are experiencing. Test out the search on the front end to confirm that it is working.

(via Magento)

3 Comment on “Fix Broken Magento Catalog Search Function

Leave a Reply

Your email address will not be published.