示例#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
 /**
  * {@inheritdoc}
  */
 public function prepareProductCollection($collection)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'prepareProductCollection');
     if (!$pluginInfo) {
         return parent::prepareProductCollection($collection);
     } else {
         return $this->___callPlugins('prepareProductCollection', 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;
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function offsetGet($offset)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'offsetGet');
     if (!$pluginInfo) {
         return parent::offsetGet($offset);
     } else {
         return $this->___callPlugins('offsetGet', func_get_args(), $pluginInfo);
     }
 }
 /**
  * @param ContextInterface $context
  * @param StateFactory $layerStateFactory
  * @param ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory
  * @param ResourceModel\Product $catalogProduct
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Registry $registry
  * @param CategoryRepositoryInterface $categoryRepository
  * @param array $data
  */
 public function __construct(ContextInterface $context, StateFactory $layerStateFactory, \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Catalog\Model\ResourceModel\Product $catalogProduct, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Registry $registry, CategoryRepositoryInterface $categoryRepository, array $data = [])
 {
     parent::__construct($context, $layerStateFactory, $attributeCollectionFactory, $catalogProduct, $storeManager, $registry, $categoryRepository, $data);
 }