diff --git a/src/app/code/community/IntegerNet/Solr/Block/Result/List.php b/src/app/code/community/IntegerNet/Solr/Block/Result/List.php index 52e489b..2851fcf 100644 --- a/src/app/code/community/IntegerNet/Solr/Block/Result/List.php +++ b/src/app/code/community/IntegerNet/Solr/Block/Result/List.php @@ -76,10 +76,17 @@ protected function _beforeToHtml() // called prepare sortable parameters $collection = $this->_getProductCollection(); - // use sortable parameters - if ($orders = $this->getAvailableOrders()) { + // use sortable parameters depending on category settings if available + if (Mage::helper('integernet_solr')->page()->isCategoryPage() + && $category = Mage::registry('current_category')) { + $orders = $category->getAvailableSortByOptions(); + } else { + $orders = $this->getAvailableOrders(); + } + if ($orders) { $toolbar->setAvailableOrders($orders); } + if ($sort = $this->getSortBy()) { $toolbar->setDefaultOrder($sort); }