/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = parent::isVisible(); if ($result) { $cnd = new \XLite\Core\CommonCell(); $cnd->{\XLite\Module\XC\News\Model\Repo\NewsMessage::SEARCH_ENABLED} = true; $count = \XLite\Core\Database::getRepo('XLite\\Module\\XC\\News\\Model\\NewsMessage')->search($cnd, true); $result = $count > 0; } return $result; }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { return parent::isVisible() && $this->getProduct()->isAvailable(); }
/** * Register the CSS classes for this block * * @return string */ protected function getBlockClasses() { return parent::getBlockClasses() . ' block-top-categories'; }
/** * Define widget parameters * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array(self::PARAM_DISPLAY_MODE => new \XLite\Model\WidgetParam\Set('Display mode', self::DISPLAY_MODE_HORIZONTAL, true, $this->displayModes)); }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { return parent::isVisible() && !$this->isCheckoutLayout(); }
/** * Register the CSS classes for this block * * @return string */ protected function getBlockClasses() { return parent::getBlockClasses() . ' block-product-filter'; }
/** * Define widget parameters * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $rootId = $this->getDefaultCategoryId(); $this->widgetParams += array(self::PARAM_DISPLAY_MODE => new \XLite\Model\WidgetParam\Set('Display mode', 'list', true, $this->displayModes), self::PARAM_ROOT_ID => new \XLite\Model\WidgetParam\ObjectId\Category('Parent category ID (leave "' . $rootId . '" for root categories list)', $rootId, true, true), self::PARAM_IS_SUBTREE => new \XLite\Model\WidgetParam\Bool('Is subtree', false, false)); }