Esempio n. 1
0
 function ishop_module_front()
 {
     $this->_module_name = 'ishop';
     $this->_common_obj =& ishop_module_common::getInstance(true);
     parent::_constructor();
     $this->context = null;
 }
Esempio n. 2
0
 function common_call($front_call = null)
 {
     $this->_module_name = 'ishop';
     $this->_common_obj = ishop_module_common::getInstance();
     $this->_common_obj->module_name = $this->_module_name;
     $this->_tree = $this->_common_obj->obj_tree;
 }
Esempio n. 3
0
 function getDiscountsSelector($userDiscount = null)
 {
     if (Common::is_module_exists('ishop')) {
         Common::call_common_instance('ishop');
         $ishop =& ishop_module_common::getInstance();
         return XHTML::arr_select_opt($ishop->getDiscoutsSchemes(), $userDiscount, true);
     }
 }
Esempio n. 4
0
 function getDiscountForCategory($id)
 {
     static $dscheme;
     if ($this->ishop && $_SESSION['siteuser']['authorized']) {
         Common::call_common_instance('ishop');
         $ishop =& ishop_module_common::getInstance();
         if (!$dscheme) {
             $dscheme = $ishop->getDiscountScheme($_SESSION['siteuser']['userdata']['DiscountScheme']);
         }
         if ($dscheme) {
             $this->_tree->GetFullBonesUp($id);
             if ($fbu = XARRAY::arr_to_keyarr($this->_tree->FullBonesMas, 'id', 'id')) {
                 foreach ($fbu as $bone) {
                     if (($fkey = array_search($bone, array_flip($dscheme))) !== false) {
                         return $fkey;
                     }
                 }
             }
         }
     }
 }