Example #1
0
 /**
  * Default customer account page
  *
  * @return \Magento\Framework\View\Result\Page
  */
 public function execute()
 {
     if (!$this->_brandHelper->getConfig('general_settings/enable')) {
         return $this->resultForwardFactory->create()->forward('noroute');
     }
     /** @var \Magento\Framework\View\Result\Page $resultPage */
     $page = $this->resultPageFactory->create();
     return $page;
 }
Example #2
0
 /**
  * Default customer account page
  *
  * @return \Magento\Framework\View\Result\Page
  */
 public function execute()
 {
     if (!$this->_brandHelper->getConfig('general_settings/enable')) {
         return $this->resultForwardFactory->create()->forward('noroute');
     }
     $brand = $this->_initBrand();
     if ($brand) {
         $this->layerResolver->create('brand');
         /** @var \Magento\Framework\View\Result\Page $resultPage */
         $page = $this->resultPageFactory->create();
         // apply custom layout (page) template once the blocks are generated
         if ($brand->getPageLayout()) {
             $page->getConfig()->setPageLayout($brand->getPageLayout());
         }
         $page->addHandle(['type' => 'VES_BRAND_' . $brand->getId()]);
         if (($layoutUpdate = $brand->getLayoutUpdateXml()) && trim($layoutUpdate) != '') {
             $page->addUpdate($layoutUpdate);
         }
         /*$collectionSize = $brand->getProductCollection()->getSize();
           if($collectionSize){
               $page->addHandle(['type' => 'vesbrand_brand_layered']);
           }*/
         $page->getConfig()->addBodyClass('page-products')->addBodyClass('brand-' . $brand->getUrlKey());
         return $page;
     } elseif (!$this->getResponse()->isRedirect()) {
         return $this->resultForwardFactory->create()->forward('noroute');
     }
 }
Example #3
0
 public function getConfig($key, $default = '')
 {
     $result = $this->_brandHelper->getConfig($key);
     if (!$result) {
         return $default;
     }
     return $result;
 }
Example #4
0
 /**
  * Default customer account page
  *
  * @return \Magento\Framework\View\Result\Page
  */
 public function execute()
 {
     if (!$this->_brandHelper->getConfig('general_settings/enable')) {
         return $this->resultForwardFactory->create()->forward('noroute');
     }
     $group = $this->_initGroup();
     if ($group) {
         $page = $this->resultPageFactory->create();
         $page->getConfig()->addBodyClass('group-' . $group->getUrlKey());
         return $page;
     } elseif (!$this->getResponse()->isRedirect()) {
         return $this->resultForwardFactory->create()->forward('noroute');
     }
 }