Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/code/local/Mage/CatalogSearch/Block/Autocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -57,7 +57,7 @@ protected function _toHtml()
}

$html .= '<li title="'.$this->escapeHtml($item['title']).'" class="'.$item['row_class'].'">'
. '<a href="'.$item['url_path'].'"><img src="'.$item['image_url'].'" /><span>'.$this->escapeHtml($item['title']).'</span></a></li>';
. '<a href="'.$item['url_path'].'"><div style="max-width:30%; float:left;" class="product-photo-search"><img src="'.$item['image_url'].'" /></div><div style="max-width:69%; float:left; margin-top:6px;padding-left:3px" class="name-product-search"><span>'.$this->escapeHtml($item['title']). "<br />". "<span style='display:inline-block; margin-top:6px;' class='price-custom-span'>Price: " . number_format((float)$item['price'], 2, '.', '') . "" . $current_store_symbol .'</span></span></div></a></li>';
}

$html.= '</ul>';
Expand All @@ -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);
Expand All @@ -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()
);

Expand Down