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; } }