From f41ee0ddd110e2d4c991ce7ff7d5035d75ed7b90 Mon Sep 17 00:00:00 2001 From: Kostas Timpas Date: Wed, 4 Oct 2017 16:47:30 +0300 Subject: [PATCH 1/2] Update Autocomplete.php Added Price to each product result --- app/code/local/Mage/CatalogSearch/Block/Autocomplete.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php b/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php index 77b0b92..01ab418 100644 --- a/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php +++ b/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php @@ -57,7 +57,7 @@ protected function _toHtml() } $html .= '
  • ' - . ''.$this->escapeHtml($item['title']).'
  • '; + . ''; } $html.= ''; @@ -73,7 +73,8 @@ public function getSuggestData() ->addAttributeToFilter('name', array( 'like' => '%'.$query.'%' )) - ->setPageSize(5) + ->addAttributeToSelect('price') + ->setPageSize(8) ->addAttributeToSelect('small_image') ->addAttributeToSelect('url_path') ->addAttributeToFilter('visibility', 4); @@ -83,8 +84,9 @@ public function getSuggestData() foreach ($collection as $item) { $_data = array( 'title' => $item->getName(), + 'price' => $item->getPrice(), 'row_class' => (++$counter)%2?'odd':'even', - 'image_url' => (string)Mage::helper('catalog/image')->init($item, 'small_image')->resize(50), + 'image_url' => (string)Mage::helper('catalog/image')->init($item, 'small_image')->resize(70), 'url_path' => $item->getUrlPath() ); From cfc87109937f442e4441015bcea032dcbdc72831 Mon Sep 17 00:00:00 2001 From: Kostas Timpas Date: Tue, 10 Oct 2017 10:28:00 +0300 Subject: [PATCH 2/2] Updated Autocomplete.php Added price and currency symbol of current store view. --- app/code/local/Mage/CatalogSearch/Block/Autocomplete.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php b/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php index 01ab418..ac2e2ed 100644 --- a/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php +++ b/app/code/local/Mage/CatalogSearch/Block/Autocomplete.php @@ -34,7 +34,7 @@ class Mage_CatalogSearch_Block_Autocomplete extends Mage_Core_Block_Abstract protected function _toHtml() { $html = ''; - + $current_store_symbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); if (!$this->_beforeToHtml()) { return $html; } @@ -57,7 +57,7 @@ protected function _toHtml() } $html .= '
  • ' - . '
  • '; + . ''; } $html.= '';