Exemple #1
0
 /**
  * Sets oxcmp_oxuser::blIsComponent = true, fetches user error
  * code and sets it to default - 0. Executes parent::init().
  *
  * Session variable:
  * <b>usr_err</b>
  */
 public function init()
 {
     $this->_saveDeliveryAddressState();
     $this->_loadSessionUser();
     $this->_saveInvitor();
     parent::init();
 }
 /**
  * Executes parent::init(), searches for active category in URL,
  * session, post variables ("cnid", "cdefnid"), active article
  * ("anid", usually article details), then loads article and
  * category if any of them available. Generates category/navigation
  * list.
  *
  * @return null
  */
 public function init()
 {
     parent::init();
     // Performance
     $myConfig = $this->getConfig();
     if ($myConfig->getConfigParam('blDisableNavBars') && $myConfig->getActiveView()->getIsOrderStep()) {
         return;
     }
     $sActCat = $this->_getActCat();
     //@deprecated in v.4.5.7, since 2012-02-15; config option removed bug #0003385
     if ($myConfig->getConfigParam('bl_perfLoadVendorTree')) {
         // building vendor tree
         $this->_loadVendorTree($sActCat);
     }
     if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
         // building Manufacturer tree
         $sActManufacturer = oxConfig::getParameter('mnid');
         $this->_loadManufacturerTree($sActManufacturer);
     }
     if ($myConfig->getConfigParam('bl_perfLoadCatTree')) {
         // building categorytree for all purposes (nav, search and simple category trees)
         $this->_loadCategoryTree($sActCat);
         if ($myConfig->getConfigParam('blTopNaviLayout')) {
             if (!($sActCont = oxConfig::getParameter('oxcid'))) {
                 $sActCont = oxConfig::getParameter('tpl');
             }
             $this->_oMoreCat = $this->_getMoreCategory($sActCat, $sActCont);
         }
     }
 }
 /**
  * Initiates component.
  */
 public function init()
 {
     $oConfig = $this->getConfig();
     if ($oConfig->getConfigParam('blPsBasketReservationEnabled')) {
         if ($oReservations = $this->getSession()->getBasketReservations()) {
             if (!$oReservations->getTimeLeft()) {
                 $oBasket = $this->getSession()->getBasket();
                 if ($oBasket && $oBasket->getProductsCount()) {
                     $this->emptyBasket($oBasket);
                 }
             }
             $iLimit = (int) $oConfig->getConfigParam('iBasketReservationCleanPerRequest');
             if (!$iLimit) {
                 $iLimit = 200;
             }
             $oReservations->discardUnusedReservations($iLimit);
         }
     }
     parent::init();
     // Basket exclude
     if ($this->getConfig()->getConfigParam('blBasketExcludeEnabled')) {
         if ($oBasket = $this->getSession()->getBasket()) {
             $this->getParent()->setRootCatChanged($this->isRootCatChanged() && $oBasket->getContents());
         }
     }
 }
Exemple #4
0
 /**
  * Checks for currency parameter set in URL, session or post
  * variables. If such were found - loads all currencies possible
  * in shop, searches if passed is available (if no - default
  * currency is set the first defined in admin). Then sets currency
  * parameter so session ($myConfig->setActShopCurrency($iCur)),
  * loads basket and forces ir to recalculate (oBasket->blCalcNeeded
  * = true). Finally executes parent::init().
  *
  * @return null
  */
 public function init()
 {
     // Performance
     $myConfig = $this->getConfig();
     if (!$myConfig->getConfigParam('bl_perfLoadCurrency')) {
         //#861C -  show first currency
         $aCurrencies = $myConfig->getCurrencyArray();
         $this->_oActCur = current($aCurrencies);
         return;
     }
     $iCur = oxRegistry::getConfig()->getRequestParameter('cur');
     if (isset($iCur)) {
         $aCurrencies = $myConfig->getCurrencyArray();
         if (!isset($aCurrencies[$iCur])) {
             $iCur = 0;
         }
         // set new currency
         $myConfig->setActShopCurrency($iCur);
         // recalc basket
         $oBasket = $this->getSession()->getBasket();
         $oBasket->onUpdate();
     }
     $iActCur = $myConfig->getShopCurrency();
     $this->aCurrencies = $myConfig->getCurrencyArray($iActCur);
     $this->_oActCur = $this->aCurrencies[$iActCur];
     //setting basket currency (M:825)
     if (!isset($oBasket)) {
         $oBasket = $this->getSession()->getBasket();
     }
     $oBasket->setBasketCurrency($this->_oActCur);
     parent::init();
 }
 /**
  * Executes parent::init(), searches for active category in URL,
  * session, post variables ("cnid", "cdefnid"), active article
  * ("anid", usually article details), then loads article and
  * category if any of them available. Generates category/navigation
  * list.
  *
  * @return null
  */
 public function init()
 {
     parent::init();
     // Performance
     $myConfig = $this->getConfig();
     if ($myConfig->getConfigParam('blDisableNavBars') && $myConfig->getTopActiveView()->getIsOrderStep()) {
         return;
     }
     $sActCat = $this->_getActCat();
     if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
         // building Manufacturer tree
         $sActManufacturer = oxRegistry::getConfig()->getRequestParameter('mnid');
         $this->_loadManufacturerTree($sActManufacturer);
     }
     // building category tree for all purposes (nav, search and simple category trees)
     $this->_loadCategoryTree($sActCat);
 }
Exemple #6
0
 /**
  * Calls self::_processRequest(), initializes components which needs to
  * be loaded, sets current list type, calls parent::init()
  */
 public function init()
 {
     $this->_processRequest();
     // storing current view
     $blInit = true;
     // init all components if there are any
     if ($this->_blLoadComponents) {
         foreach ($this->_getComponentNames() as $sComponentName => $blNotCacheable) {
             // do not override initiated components
             if (!isset($this->_oaComponents[$sComponentName])) {
                 // component objects MUST be created to support user called functions
                 $oComponent = oxNew($sComponentName);
                 $oComponent->setParent($this);
                 $oComponent->setThisAction($sComponentName);
                 $this->_oaComponents[$sComponentName] = $oComponent;
             }
             // do we really need to initiate them ?
             if ($blInit) {
                 $this->_oaComponents[$sComponentName]->init();
                 // executing only is view does not have action method
                 if (!method_exists($this, $this->getFncName())) {
                     $this->_oaComponents[$sComponentName]->executeFunction($this->getFncName());
                 }
             }
         }
     }
     parent::init();
 }
 /**
  * Sets some shop configuration parameters (such as language),
  * creates some list object (depends on subclass) and executes
  * parent method parent::Init().
  */
 public function init()
 {
     $myConfig = $this->getConfig();
     // authorization check
     if (!$this->_authorize()) {
         oxRegistry::getUtils()->redirect('index.php', true, 302);
         exit;
     }
     $oLang = oxRegistry::getLang();
     // language handling
     $this->_iEditLang = $oLang->getEditLanguage();
     $oLang->setBaseLanguage();
     parent::init();
     $this->_aViewData['malladmin'] = oxRegistry::getSession()->getVariable('malladmin');
 }
 /**
  * Sets oxcmp_oxuser::blIsComponent = true, fetches user error
  * code and sets it to default - 0. Executes parent::init().
  *
  * Session variable:
  * <b>usr_err</b>
  *
  * @return null
  */
 public function init()
 {
     // saving show/hide delivery address state
     $blShow = oxConfig::getParameter('blshowshipaddress');
     if (!isset($blShow)) {
         $blShow = oxSession::getVar('blshowshipaddress');
     }
     // @deprecated, remove blhideshipaddress checking when basic theme support discontinued
     if (oxConfig::getParameter('blhideshipaddress') || oxSession::getVar('blhideshipaddress')) {
         $blShow = false;
     }
     oxSession::setVar('blshowshipaddress', $blShow);
     // load session user
     $this->_loadSessionUser();
     if ($this->getConfig()->getConfigParam('blInvitationsEnabled')) {
         // get invitor ID
         $this->getInvitor();
         $this->setRecipient();
     }
     parent::init();
 }