コード例 #1
0
ファイル: Result.php プロジェクト: aiesh/magento2
 /**
  * Set order options
  *
  * @return void
  */
 public function setListOrders()
 {
     /* @var $category \Magento\Catalog\Model\Category */
     $category = $this->_catalogLayer->getCurrentCategory();
     $availableOrders = $category->getAvailableSortByOptions();
     unset($availableOrders['position']);
     $this->getChildBlock('search_result_list')->setAvailableOrders($availableOrders);
 }
コード例 #2
0
ファイル: Interceptor.php プロジェクト: rustamveer/magento2
 /**
  * {@inheritdoc}
  */
 public function getCurrentCategory()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCurrentCategory');
     if (!$pluginInfo) {
         return parent::getCurrentCategory();
     } else {
         return $this->___callPlugins('getCurrentCategory', func_get_args(), $pluginInfo);
     }
 }
コード例 #3
0
ファイル: Result.php プロジェクト: aiesh/magento2
 /**
  * Set search available list orders
  *
  * @return $this
  */
 public function setListOrders()
 {
     $category = $this->catalogLayer->getCurrentCategory();
     /* @var $category \Magento\Catalog\Model\Category */
     $availableOrders = $category->getAvailableSortByOptions();
     unset($availableOrders['position']);
     $availableOrders = array_merge(array('relevance' => __('Relevance')), $availableOrders);
     $this->getListBlock()->setAvailableOrders($availableOrders)->setDefaultDirection('desc')->setSortBy('relevance');
     return $this;
 }