Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * Check if widget is visible
  *
  * @return boolean
  */
 protected function isVisible()
 {
     return parent::isVisible() && $this->getProduct()->isAvailable();
 }
Beispiel #3
0
 /**
  * Register the CSS classes for this block
  *
  * @return string
  */
 protected function getBlockClasses()
 {
     return parent::getBlockClasses() . ' block-top-categories';
 }
Beispiel #4
0
 /**
  * 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));
 }
Beispiel #5
0
 /**
  * Check if widget is visible
  *
  * @return boolean
  */
 protected function isVisible()
 {
     return parent::isVisible() && !$this->isCheckoutLayout();
 }
Beispiel #6
0
 /**
  * Register the CSS classes for this block
  *
  * @return string
  */
 protected function getBlockClasses()
 {
     return parent::getBlockClasses() . ' block-product-filter';
 }
Beispiel #7
0
 /**
  * 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));
 }