Fix Broken Magento Catalog Search Function
on September 24, 2014
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)
Thanks, It has almost solved my problem for Advanced serach, which was stopped working suddenly, but still my search is not working from home page(main search), could you please help, Iam non-technical guy still your pointwise step help alot,
Waiting for some awesome response…!
I have done this but it shows the same error: /app/code/core/Mage/CatalogSearch/Block/Result.php on line 172
Thank you! Works perfect on magento 1.8!