Example #1
0
 /**
  * Clear list
  *
  * @return void
  */
 public function clearTopMessages()
 {
     parent::clearTopMessages();
     if (\XLite\Core\CMSConnector::isCMSStarted()) {
         \XLite\Module\CDev\DrupalConnector\Handler::getInstance()->clearTopMessages();
     }
 }
Example #2
0
 /**
  * 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);
     }
 }
Example #3
0
 /**
  * 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());
     }
 }
Example #4
0
 /**
  * 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';
 }
Example #5
0
 /**
  * Constructor
  *
  * @return void
  */
 protected function __construct()
 {
     parent::__construct();
     $this->widgetsList['\\XLite\\Module\\CDev\\FeaturedProducts\\View\\Customer\\FeaturedProducts'] = 'Featured products';
 }
Example #6
0
 /**
  * Constructor
  *
  * @return void
  */
 protected function __construct()
 {
     parent::__construct();
     $this->widgetsList['\\XLite\\Module\\CDev\\Sale\\View\\SaleBlock'] = 'Products on sale';
 }
Example #7
0
 /**
  * Constructor
  *
  * @return void
  */
 protected function __construct()
 {
     parent::__construct();
     $this->widgetsList['\\XLite\\Module\\XC\\Upselling\\View\\Customer\\UpsellingProducts'] = 'Related products';
 }
Example #8
0
 /**
  * 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;
 }
Example #9
0
 /**
  * Constructor
  *
  * @return void
  */
 protected function __construct()
 {
     parent::__construct();
     $this->widgetsList['\\XLite\\Module\\CDev\\Bestsellers\\View\\Bestsellers'] = 'Bestsellers list';
 }
Example #10
0
 /**
  * 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()));
 }
Example #11
0
 /**
  * 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);
 }
Example #12
0
 /**
  * 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;
 }
Example #13
0
 /**
  * Initialization
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->mapRequest($this->getLCArgs());
     $this->setPreviousTopMessages();
 }
Example #14
0
 /**
  * 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;
 }
Example #15
0
 /**
  * Determines if need to display only a widget body
  *
  * @return boolean
  */
 protected function useBodyTemplate()
 {
     return \XLite\Core\CMSConnector::isCMSStarted() && $this->isWrapper();
 }
Example #16
0
 /**
  * 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;
 }
Example #17
0
 /**
  * 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;
 }