public function init()
 {
     parent::init();
     $this->_session = new Zend_Session_Namespace('poll');
     if (null === $this->_session->poll) {
         $this->_session->poll = array();
     }
 }
示例#2
0
 /**
  * init controller
  */
 public function init()
 {
     parent::init();
     // cart
     $cart = $this->getCart();
     $this->view->cart = $cart;
     // checkout data
     $this->checkoutManager = OnlineShop_Framework_Factory::getInstance()->getCheckoutManager($cart);
     $this->view->deliveryAddress = $this->checkoutManager->getCheckoutStep('deliveryaddress');
     // user
     $customer = $this->currentUser;
     if ($customer) {
         $this->customer = $customer;
         $this->view->customer = $customer;
     }
     // if cart is empty, redirect user to the cart list view
     if (count($cart->getItems()) == 0 && !$this->getParam("id")) {
         $this->redirect($this->view->url(array('action' => 'list'), 'cart'));
     }
 }
 public function init()
 {
     parent::init();
     if (file_exists(PIMCORE_WEBSITE_PATH . "/var/search/search.xml")) {
         $searchConf = new Zend_Config_Xml(PIMCORE_WEBSITE_PATH . "/var/search/search.xml");
         if ($searchConf->search->frontend->enabled) {
             try {
                 Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive());
                 $this->frontendIndex = Zend_Search_Lucene::open(SearchPhp_Plugin::getFrontendSearchIndex());
                 $this->categories = explode(",", $searchConf->search->frontend->categories);
                 if ($searchConf->search->frontend->ignoreLanguage != '1') {
                     $this->searchLanguage = $this->_getParam("language");
                     if (empty($this->searchLanguage)) {
                         try {
                             $this->searchLanguage = Zend_Registry::get("Zend_Locale");
                         } catch (Exception $e) {
                             $this->searchLanguage = "en";
                         }
                     }
                 } else {
                     $this->searchLanguage = null;
                 }
                 $this->fuzzySearch = false;
                 if ($searchConf->search->frontend->fuzzySearch == '1') {
                     $this->fuzzySearch = true;
                 }
                 if ($searchConf->search->frontend->ownHostOnly) {
                     $this->ownHostOnly = true;
                 }
             } catch (Exception $e) {
                 //p_r($e);
                 throw new Exception("could not open index");
             }
         } else {
             throw new Exception("search frontend is not installed and enabled.");
         }
     }
 }
示例#4
0
 /**
  * init wishlist controller
  */
 public function init()
 {
     parent::init();
     // load wishlist
     $this->wishlist = $this->getWishlist();
 }
示例#5
0
 public function init()
 {
     parent::init();
     $params = $this->getAllParams();
     $this->view->category = Website_ShopCategory::getById($params['category']);
 }
示例#6
0
 /**
  * init cart controller
  */
 public function init()
 {
     parent::init();
     // get cart
     $this->cart = $this->getCart();
 }