order_total Class Reference

Inherits AbstractAcaModule.

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Definition at line 17 of file order_total.php.


Member Function Documentation

order_total::_extents ( funct,
action = '' 
)

Definition at line 199 of file order_total.php.

00199                                       {
00200     global  $page, $lang;
00201     $res=array();
00202     reset($this->modules);
00203     if(empty($funct)) return;
00204     foreach ($this->modules as $key=>$module) {
00205       if (($module->enabled)  && (isset($module->shopping_cart) && $module->shopping_cart)  && (method_exists($module, $funct ))) $res[$key]=$this->modules[$key]->$funct($action);
00206     }
00207     return $res;
00208   }

order_total::draw_cart ( class = '',
product = '' 
)

Definition at line 146 of file order_total.php.

00146                                            {
00147     global  $page, $lang,$goto,$parameters, $cart;
00148     if (!empty($class)) {
00149       if (isset($this->modules[$class]) && $this->modules[$class]->enabled && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct ))){
00150         $funct='draw_cart';
00151         $product= $this->modules[$class]->$funct($product);
00152       }
00153     } else {
00154       reset($this->modules);
00155       foreach ($this->modules as $key=>$module) {
00156         $funct='draw_cart';
00157         if (($module->enabled)  && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct )) ) {
00158           $product= $this->modules[$key]->$funct($product);
00159         }
00160       }
00161     }
00162     return $product;
00163   }

order_total::order_total (  ) 

Constructor.

Definition at line 24 of file order_total.php.

00024                          {
00025     global $language,$customer_id, $page, $cart;
00026     $this->modules=array();
00027     $this->list_mod=array();
00028 
00029 
00030     foreach(parent::initialise_type('MODULE_ORDER_TOTAL_INSTALLED','order_total') as $class){
00031       $cl[$class]=new $class ();
00032       $list_mod[$cl[$class]->sort_order] = $class ;
00033     }
00034 
00035     if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') $customer_group_id = $_SESSION['sppc_customer_group_id'];
00036     else  $customer_group_id = '0';
00037 
00038     $customer_ot_query = tep_db_query("select IF(c.customers_order_total_allowed <> '', c.customers_order_total_allowed, cg.group_order_total_allowed) as order_total_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id =  '" . $customer_group_id . "'");
00039     $customer_ot = tep_db_fetch_array($customer_ot_query);
00040     $temp_ot_array= (tep_not_null($customer_ot['order_total_allowed']) )  ? explode(';', $customer_ot['order_total_allowed']) : array() ;
00041 
00042     if(!isset($list_mod) ||!is_array($list_mod) || count($list_mod)==0) return false;
00043     ksort($list_mod);
00044     foreach($list_mod as $s=>$class){
00045       if ( count($temp_ot_array)==0 || in_array($class.'.php', $temp_ot_array ) ) $GLOBALS[$class]=$this->modules[$class] =$cl[$class];
00046     }
00047     unset($cl);unset($list_mod);
00048 
00049     return $this->modules;
00050   }

order_total::output ( f_lin = "<tr>%s</tr>",
f_col = '<td colspan="4" class="otTtitle">%s</td><td class="otText">%s</td><td class="otText">%s</td>' 
)

Definition at line 82 of file order_total.php.

Referenced by process().

00082                                                                                                                                                       {
00083     global $GLOBALS;
00084     $output_string = '';
00085 
00086     if (is_array($this->modules)) {
00087       reset($this->modules);
00088       while (list($class, $value) = each($this->modules)) {
00089         if ($GLOBALS[$class]->enabled) {
00090           $size = sizeof($GLOBALS[$class]->output);
00091 
00092           for ($i=0; $i<$size; $i++) {
00093             $output_string .=sprintf($f_lin,
00094                                       sprintf($f_col,
00095                                               $GLOBALS[$class]->output[$i]['title'],
00096                                               @$GLOBALS[$class]->output[$i]['text_ht'],
00097                                               $GLOBALS[$class]->output[$i]['text'])
00098                                     ."\n")
00099                             ."\n";
00100           }
00101         }
00102       }
00103     }
00104 
00105     return $output_string;
00106   }

order_total::process (  ) 

---- CHECKOUT PROCESS ------

Definition at line 55 of file order_total.php.

00055                             {
00056     $order_total_array = array();
00057     if (is_array($this->modules) && count($this->modules)>0) {
00058       reset($this->modules);
00059       while (list($class, $value) = each($this->modules)) {
00060         if ($GLOBALS[$class]->enabled) {
00061           $GLOBALS[$class]->process();
00062 
00063           for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
00064             if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
00065               $order_total_array[] = array( 'code' => $GLOBALS[$class]->code,
00066                                             'title' => $GLOBALS[$class]->output[$i]['title'],
00067                                             'text_ht' => @$GLOBALS[$class]->output[$i]['text_ht'],
00068                                             'text' => $GLOBALS[$class]->output[$i]['text'],
00069                                             'value_ht' => $GLOBALS[$class]->output[$i]['value_ht'],
00070                                             'value' => $GLOBALS[$class]->output[$i]['value'],
00071                                             'sort_order' => $GLOBALS[$class]->sort_order);
00072             }
00073           }
00074         }
00075       }
00076     }
00077     return $order_total_array;
00078   }

order_total::process_cart ( class = '',
product = '' 
)

Definition at line 172 of file order_total.php.

00172                                               {
00173     global  $page, $lang,$goto,$parameters;;
00174     if (!empty($class)) {
00175       if (isset($this->modules[$class]) && $this->modules[$class]->enabled && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct ))){
00176         $funct='process_cart';
00177         $product= $this->modules[$class]->$funct($product);
00178       }
00179     } else {
00180       reset($this->modules);
00181       foreach ($this->modules as $key=>$module) {
00182         $funct='process_cart';
00183         if (($module->enabled)  && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct )) ) {
00184           $product= $this->modules[$key]->$funct($product);
00185         }
00186       }
00187     }
00188     return $product;
00189   }

order_total::shopping_cart_action ( class = '',
action = '' 
)

Definition at line 117 of file order_total.php.

00117                                                      {
00118     global  $page, $lang,$goto,$parameters;;
00119     if (!empty($class)) {
00120       if (isset($this->modules[$class]) && $this->modules[$class]->enabled){
00121         $funct='shopping_cart_action';
00122         return $this->modules[$class]->$funct($action);
00123       }
00124     } else {
00125       reset($this->modules);
00126       foreach ($this->modules as $key=>$module) {
00127         $funct='shopping_cart_action';
00128         if (($module->enabled)  and (method_exists($module, $funct ))) {
00129           return $this->modules[$key]->$funct($action);
00130         }
00131       }
00132     }
00133     return false;
00134   }


Member Data Documentation

order_total::$modules

Definition at line 19 of file order_total.php.


The documentation for this class was generated from the following file: