[Magento] Default Search / Mini Search returns 0 results

Was debugging this weird problem with a client's Magento site.

The Mini Search (and the default search - http://example.com/catalogsearch/result/?q=searchTerm) is not returning the correct result.

Surprisingly the advanced search is working fine.

After trying out all sort of methods, finding and editing the .phtml, .xml files. I found out that its one of the core files that causes this issue.


Open up app/code/core/Mage/CatalogSearch/Block/Result.php

Uncomment line 149 and 150
//        $this->getListBlock()
//           ->setCollection($this->_getProductCollection());

Then change line 172
$this->_productCollection = $this->getListBlock()->getLoadedProductCollection();
$this->_productCollection = Mage::getSingleton('catalogsearch/layer')->getProductCollection();

That solves the search problem.



  1. Awesome! Searched everywhere for a solution and this worked perfectly. Thanks so much!

  2. Thank you. You have saved my life (well, more or less ;-) )
    Searched for a solution so long, finally found this. Works perfectly.
    Great Deal! :D

  3. A quick thanks from me too. The change worked perfectly.

  4. Sorry, Your given solution is not working for me. I am using magento1.7 kindly provide some more solutions.

  5. You are a life saver.... millions thankssss


Post a Comment

Popular posts from this blog


Generate GoDaddy SSL Certificate (.crt) for Azure Websites (.pfx)

PayDollar Test Credit Cards