Esempio n. 1
0
 public function getConfig($key, $default = '')
 {
     $widget_key = explode('/', $key);
     if (count($widget_key) == 2 && ($resultData = $this->hasData($widget_key[1]))) {
         return $this->getData($widget_key[1]);
     }
     $result = $this->_brandHelper->getConfig($key);
     if ($result == "") {
         return $default;
     }
     return $result;
 }
Esempio n. 2
0
 public function _toHtml()
 {
     if (!$this->_brandHelper->getConfig('general_settings/enable')) {
         return;
     }
     $carousel_layout = $this->getConfig('carousel_layout');
     if ($carousel_layout == 'owl_carousel') {
         $this->setTemplate('widget/brand_list_owl.phtml');
     } else {
         $this->setTemplate('widget/brand_list_bootstrap.phtml');
     }
     if (($template = $this->getConfig('template')) != '') {
         $this->setTemplate($template);
     }
     return parent::_toHtml();
 }
Esempio n. 3
0
 /**
  * Prepare breadcrumbs
  *
  * @param \Magento\Cms\Model\Page $brand
  * @throws \Magento\Framework\Exception\LocalizedException
  * @return void
  */
 protected function _addBreadcrumbs()
 {
     $breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs');
     $baseUrl = $this->_storeManager->getStore()->getBaseUrl();
     $brandRoute = $this->_brandHelper->getConfig('general_settings/route');
     $page_title = $this->_brandHelper->getConfig('brand_list_page/page_title');
     $brand = $this->getCurrentBrand();
     $group = '';
     if ($groupId = $brand->getGroupId()) {
         $group = $this->_groupModel->load($groupId);
     }
     $breadcrumbsBlock->addCrumb('home', ['label' => __('Home'), 'title' => __('Go to Home Page'), 'link' => $baseUrl]);
     $breadcrumbsBlock->addCrumb('vesbrand', ['label' => $page_title, 'title' => $page_title, 'link' => $baseUrl . $brandRoute]);
     if ($group && $group->getStatus()) {
         $breadcrumbsBlock->addCrumb('group', ['label' => $group->getName(), 'title' => $group->getName(), 'link' => $group->getUrl()]);
     }
     $breadcrumbsBlock->addCrumb('brand', ['label' => $brand->getName(), 'title' => $brand->getName(), 'link' => '']);
 }
Esempio n. 4
0
 public function getUrl()
 {
     $url = $this->_storeManager->getStore()->getBaseUrl();
     $route = $this->_brandHelper->getConfig('general_settings/route');
     $url_prefix = $this->_brandHelper->getConfig('general_settings/url_prefix');
     $urlPrefix = '';
     if ($url_prefix) {
         $urlPrefix = $url_prefix . '/';
     }
     $url_suffix = $this->_brandHelper->getConfig('general_settings/url_suffix');
     return $url . $urlPrefix . $this->getUrlKey() . $url_suffix;
 }