I'm trying to sort the products in search result by "Position". Obviously this works in product listing but i found out that it is commented in Block Result.php:
/**
* Set search available list orders
*
* @return Mage_CatalogSearch_Block_Result
*/
public function setListOrders()
{
$category = Mage::getSingleton('catalog/layer')
->getCurrentCategory();
/* @var $category Mage_Catalog_Model_Category */
$availableOrders = $category->getAvailableSortByOptions();
unset($availableOrders['position']);
$availableOrders = array_merge(array(
'relevance' => $this->__('Relevance')
), $availableOrders);
$this->getListBlock()
->setAvailableOrders($availableOrders)
->setDefaultDirection('desc')
->setSortBy('relevance');
return $this;
}
I removed the unset($availableOrders['position']); but Magento throws an SQL error.
Does anyone know how can I achieve this?
Thanks a lot!