/**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function getResponse()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse');
     if (!$pluginInfo) {
         return parent::getResponse();
     } else {
         return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo);
     }
 }
Beispiel #3
0
 /**
  * Display search result
  *
  * @return void
  */
 public function execute()
 {
     if ($this->bxHelperData->isSearchEnabled()) {
         $this->layerResolver->create(Resolver::CATALOG_LAYER_SEARCH);
         /* @var $query \Magento\Search\Model\Query */
         $query = $this->_queryFactory->get();
         try {
             if ($this->p13Helper->areThereSubPhrases()) {
                 $queries = $this->p13Helper->getSubPhrasesQueries();
                 if (count($queries) == 1) {
                     $this->_redirect('*/*/*', array('_current' => true, '_query' => array('q' => $queries[0])));
                 }
             }
             if ($this->p13Helper->areResultsCorrected()) {
                 $correctedQuery = $this->p13Helper->getCorrectedQuery();
                 $query->setQueryText($correctedQuery);
             }
         } catch (\Exception $e) {
             $this->bxHelperData->setFallback(true);
             $this->_logger->critical($e);
         }
         $query->setStoreId($this->_storeManager->getStore()->getId());
         if ($query->getQueryText() != '') {
             if ($this->_objectManager->get('Magento\\CatalogSearch\\Helper\\Data')->isMinQueryLength()) {
                 $query->setId(0)->setIsActive(1)->setIsProcessed(1);
             } else {
                 $query->saveIncrementalPopularity();
                 if ($query->getRedirect()) {
                     $this->getResponse()->setRedirect($query->getRedirect());
                     return;
                 }
             }
             $this->_objectManager->get('Magento\\CatalogSearch\\Helper\\Data')->checkNotes();
             $this->_view->loadLayout();
             $this->_view->renderLayout();
         } else {
             $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
         }
     } else {
         parent::execute();
     }
 }