From 7cdcfc064a6e35647d1292bb0c150a4e2908750d Mon Sep 17 00:00:00 2001 From: Kingsy Date: Thu, 4 Oct 2012 17:25:03 +0200 Subject: [PATCH 1/3] Update src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php $numResults edited to allow new search terms --- .../EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php index 6cb9f71..22c305f 100755 --- a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php +++ b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php @@ -19,7 +19,7 @@ class Dh_EmptyHandles_Model_Handler_Catalogsearch_Result_Index */ public function execute(Varien_Event $event) { - $numResults = (bool)Mage::helper('catalogsearch')->getQuery()->getNumResults(); + $numResults = Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize(); if (! $numResults) { $this->_addHandle('catalogsearch_result_index_empty'); } From a603f6f6078f348fd5df48061b4d77eb862f65ad Mon Sep 17 00:00:00 2001 From: Kingsy Date: Thu, 4 Oct 2012 17:33:54 +0200 Subject: [PATCH 2/3] Update src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php Forgot to cast to (bool) --- .../EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php index 22c305f..0ca00f7 100755 --- a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php +++ b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php @@ -19,7 +19,7 @@ class Dh_EmptyHandles_Model_Handler_Catalogsearch_Result_Index */ public function execute(Varien_Event $event) { - $numResults = Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize(); + $numResults = (bool)Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize(); if (! $numResults) { $this->_addHandle('catalogsearch_result_index_empty'); } From 788e6263ae8b4631d86dc259716d908249653003 Mon Sep 17 00:00:00 2001 From: Kingsy Date: Thu, 4 Oct 2012 17:39:02 +0200 Subject: [PATCH 3/3] Update src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php --- .../EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php index 0ca00f7..430ad93 100755 --- a/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php +++ b/src/app/code/community/Dh/EmptyHandles/Model/Handler/Catalogsearch/Result/Index.php @@ -19,7 +19,8 @@ class Dh_EmptyHandles_Model_Handler_Catalogsearch_Result_Index */ public function execute(Varien_Event $event) { - $numResults = (bool)Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize(); + $helper = Mage::helper('catalogsearch'); + $numResults = (bool)$helper->getEngine()->getResultCollection()->addSearchFilter($helper->getQuery()->getQueryText())->getSize(); if (! $numResults) { $this->_addHandle('catalogsearch_result_index_empty'); }