public function afterExecute($controller, $result) { if ($result instanceof \Magento\Framework\View\Result\Page && $this->helper->isEnabledOnFrontend() && $this->helper->getNavToSearch()) { $categoryId = $this->context->getRequest()->getParam('id'); if (!$this->helper->isCategoryIdBlacklisted($categoryId)) { $result->getConfig()->setPageLayout('1column'); } } return $result; }
public function execute(\Magento\Framework\Event\Observer $observer) { if (!$this->helper->isEnabledOnFrontend()) { return; } $view = $this->context->getView(); $page = $view->getPage(); $layoutUpdate = $page->getLayout()->getUpdate(); $layoutUpdate->addHandle('conversionpro_catalogsearch_result_index'); $page->getConfig()->setPageLayout('1column'); }
public function execute(\Magento\Framework\Event\Observer $observer) { if (!$this->helper->isEnabledOnFrontend()) { return; } $layoutUpdate = $observer->getEvent()->getLayout()->getUpdate(); $fullActionName = $observer->getEvent()->getFullActionName(); switch ($fullActionName) { case 'catalogsearch_result_index': $layoutUpdate->addHandle('conversionpro_catalogsearch_result_index'); break; case 'catalog_category_view': if ($this->helper->getNavToSearch()) { $categoryId = $this->context->getRequest()->getParam('id'); if (!$this->helper->isCategoryIdBlacklisted($categoryId)) { $layoutUpdate->addHandle('conversionpro_catalog_category_view'); if ($this->helper->getHideContent()) { $layoutUpdate->addHandle('conversionpro_catalog_category_view_hide_content'); } } } break; } }