/** * Clear list * * @return void */ public function clearTopMessages() { parent::clearTopMessages(); if (\XLite\Core\CMSConnector::isCMSStarted()) { \XLite\Module\CDev\DrupalConnector\Handler::getInstance()->clearTopMessages(); } }
/** * Perform some actions after the "login" action * * @return void */ public function redirectFromLogin() { $url = $this->getRedirectFromLoginURL(); if (isset($url)) { \XLite\Core\CMSConnector::isCMSStarted() ? \XLite\Core\Operator::redirect($url, true) : $this->setReturnURL($url); } }
/** * Initialize widget (set attributes) * * @param array $params Widget params * * @return void */ public function setWidgetParams(array $params) { parent::setWidgetParams($params); if (!\XLite\Core\CMSConnector::isCMSStarted()) { $this->widgetParams[\XLite\View\Pager\APager::PARAM_SHOW_ITEMS_PER_PAGE_SELECTOR]->setValue(false); $this->widgetParams[\XLite\View\Pager\APager::PARAM_MAX_ITEMS_COUNT]->setValue($this->getMaxCount()); } }
/** * Constructor * * @return void */ protected function __construct() { parent::__construct(); $this->widgetsList['\\XLite\\Module\\CDev\\ProductAdvisor\\View\\NewArrivals'] = 'New arrivals'; $this->widgetsList['\\XLite\\Module\\CDev\\ProductAdvisor\\View\\ComingSoon'] = 'Coming soon'; $this->widgetsList['\\XLite\\Module\\CDev\\ProductAdvisor\\View\\RecentlyViewed'] = 'Recently viewed'; $this->widgetsList['\\XLite\\Module\\CDev\\ProductAdvisor\\View\\BoughtBought'] = 'Customers who bought this product also bought'; $this->widgetsList['\\XLite\\Module\\CDev\\ProductAdvisor\\View\\ViewedBought'] = 'Customers who viewed this product bought'; }
/** * Constructor * * @return void */ protected function __construct() { parent::__construct(); $this->widgetsList['\\XLite\\Module\\CDev\\FeaturedProducts\\View\\Customer\\FeaturedProducts'] = 'Featured products'; }
/** * Constructor * * @return void */ protected function __construct() { parent::__construct(); $this->widgetsList['\\XLite\\Module\\CDev\\Sale\\View\\SaleBlock'] = 'Products on sale'; }
/** * Constructor * * @return void */ protected function __construct() { parent::__construct(); $this->widgetsList['\\XLite\\Module\\XC\\Upselling\\View\\Customer\\UpsellingProducts'] = 'Related products'; }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = parent::isVisible() && \XLite\Core\Config::getInstance()->CDev->Sale->sale_enabled && static::getWidgetTarget() != \XLite\Core\Request::getInstance()->target && 0 < $this->getData(new \XLite\Core\CommonCell(), true); if ($result) { if (!\XLite\Core\CMSConnector::isCMSStarted()) { if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = in_array($this->viewListName, array('sidebar.first', 'sidebar.single')); } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = 'center.bottom' == $this->viewListName; } } } return $result; }
/** * Constructor * * @return void */ protected function __construct() { parent::__construct(); $this->widgetsList['\\XLite\\Module\\CDev\\Bestsellers\\View\\Bestsellers'] = 'Bestsellers list'; }
/** * Define widget parameters * * @return void */ protected function defineWidgetParams() { $this->widgetParams = array(self::PARAM_IS_EXPORTED => new \XLite\Model\WidgetParam\Bool('Is exported', \XLite\Core\CMSConnector::isCMSStarted())); }
/** * Check if we need to perform a redirect or not * * @return boolean */ protected static function checkRedirectStatus() { return !\XLite\Core\CMSConnector::isCMSStarted() || !\XLite\Core\Request::getInstance()->__get(\XLite\Core\CMSConnector::NO_REDIRECT); }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = static::getWidgetTarget() != \XLite\Core\Request::getInstance()->target && parent::isVisible() && 0 < $this->getItemsCount(); if ($result) { if (!\XLite\Core\CMSConnector::isCMSStarted()) { if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = in_array($this->viewListName, array('sidebar.second', 'sidebar.single')); } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = 'center.bottom' == $this->viewListName; } } } return $result; }
/** * Initialization * * @return void */ public function init() { parent::init(); $this->mapRequest($this->getLCArgs()); $this->setPreviousTopMessages(); }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = parent::isVisible(); if (!\XLite\Core\CMSConnector::isCMSStarted() && !$this->isAJAX()) { if (static::WIDGET_TYPE_SIDEBAR == $this->getParam(static::PARAM_WIDGET_TYPE)) { $result = $result && in_array($this->viewListName, array(static::SIDEBAR_LIST, static::SIDEBAR_SINGLE)); } else { $result = $result && static::CENTER_LIST == $this->viewListName; } } return $result; }
/** * Determines if need to display only a widget body * * @return boolean */ protected function useBodyTemplate() { return \XLite\Core\CMSConnector::isCMSStarted() && $this->isWrapper(); }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = parent::isVisible(); if (!\XLite\Core\CMSConnector::isCMSStarted() && !$this->isAJAX()) { if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = $result && 'sidebar.first' == $this->viewListName; } else { $result = $result && 'center.bottom' == $this->viewListName; } } return $result; }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { $result = \XLite\Core\Config::getInstance()->CDev->ProductAdvisor->rv_enabled && \XLite\Module\CDev\ProductAdvisor\Main::getProductIds() && parent::isVisible(); if ($result) { if (!\XLite\Core\CMSConnector::isCMSStarted()) { if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = in_array($this->viewListName, array('sidebar.second', 'sidebar.single')); } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) { $result = 'center.bottom' == $this->viewListName; } } } return $result; }