cod Class Reference

List of all members.

Public Member Functions

 cod ()
 update_status ()
 javascript_validation ()
 selection ()
 pre_confirmation_check ()
 confirmation ()
 process_button ()
 before_process ()
 after_process ()
 get_error ()
 check ()
 install ()
 remove ()
 keys ()

Public Attributes

 $code
 $title
 $description
 $enabled

Detailed Description

Definition at line 13 of file cod.php.


Constructor & Destructor Documentation

cod::cod  ) 
 

Definition at line 17 of file cod.php.

References $order, description, sort_order, and update_status().

00017                    {
00018       global $order;
00019 
00020       $this->code = 'cod';
00021       $this->title = MODULE_PAYMENT_COD_TEXT_TITLE;
00022       $this->description = MODULE_PAYMENT_COD_TEXT_DESCRIPTION;
00023       $this->sort_order = MODULE_PAYMENT_COD_SORT_ORDER;
00024       $this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);
00025 
00026       if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
00027         $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
00028       }
00029 
00030       if (is_object($order)) $this->update_status();
00031     }


Member Function Documentation

cod::after_process  ) 
 

Definition at line 88 of file cod.php.

00088                              {
00089       return false;
00090     }

cod::before_process  ) 
 

Definition at line 84 of file cod.php.

00084                               {
00085       return false;
00086     }

cod::check  ) 
 

Definition at line 96 of file cod.php.

References $check_query, tep_db_num_rows(), and tep_db_query().

Referenced by update_status().

00096                      {
00097       if (!isset($this->_check)) {
00098         $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_COD_STATUS'");
00099         $this->_check = tep_db_num_rows($check_query);
00100       }
00101       return $this->_check;
00102     }

cod::confirmation  ) 
 

Definition at line 76 of file cod.php.

00076                             {
00077       return false;
00078     }

cod::get_error  ) 
 

Definition at line 92 of file cod.php.

00092                          {
00093       return false;
00094     }

cod::install  ) 
 

Definition at line 104 of file cod.php.

References tep_db_query().

00104                        {
00105       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('COD Enable Cash On Delivery Module', 'MODULE_PAYMENT_COD_STATUS', 'True', 'Do you want to accept Cash On Delevery payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
00106       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('COD Payment Zone', 'MODULE_PAYMENT_COD_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
00107       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('COD Sort order of  display.', 'MODULE_PAYMENT_COD_SORT_ORDER', '0', 'Sort order of COD display. Lowest is displayed first.', '6', '0', now())");
00108       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('COD Set Order Status', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
00109    }

cod::javascript_validation  ) 
 

Definition at line 63 of file cod.php.

00063                                      {
00064       return false;
00065     }

cod::keys  ) 
 

Definition at line 115 of file cod.php.

00115                     {
00116       return array('MODULE_PAYMENT_COD_STATUS', 'MODULE_PAYMENT_COD_ZONE', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', 'MODULE_PAYMENT_COD_SORT_ORDER');
00117     }

cod::pre_confirmation_check  ) 
 

Definition at line 72 of file cod.php.

00072                                       {
00073       return false;
00074     }

cod::process_button  ) 
 

Definition at line 80 of file cod.php.

00080                               {
00081       return false;
00082     }

cod::remove  ) 
 

Definition at line 111 of file cod.php.

References tep_db_query().

00111                       {
00112       tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
00113     }

cod::selection  ) 
 

Definition at line 67 of file cod.php.

00067                          {
00068       return array('id' => $this->code,
00069                    'module' => $this->title);
00070     }

cod::update_status  ) 
 

Definition at line 34 of file cod.php.

References $check_query, $order, check(), tep_db_fetch_array(), and tep_db_query().

Referenced by cod().

00034                              {
00035       global $order;
00036 
00037       if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_COD_ZONE > 0) ) {
00038         $check_flag = false;
00039         $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
00040         while ($check = tep_db_fetch_array($check_query)) {
00041           if ($check['zone_id'] < 1) {
00042             $check_flag = true;
00043             break;
00044           } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
00045             $check_flag = true;
00046             break;
00047           }
00048         }
00049 
00050         if ($check_flag == false) {
00051           $this->enabled = false;
00052         }
00053       }
00054 
00055 // disable the module if the order only contains virtual products
00056       if ($this->enabled == true) {
00057         if ($order->content_type == 'virtual') {
00058           $this->enabled = false;
00059         }
00060       }
00061     }


Member Data Documentation

cod::$code
 

Definition at line 14 of file cod.php.

cod::$description
 

Definition at line 14 of file cod.php.

cod::$enabled
 

Definition at line 14 of file cod.php.

cod::$title
 

Definition at line 14 of file cod.php.


The documentation for this class was generated from the following file:
Generated on Fri Mar 17 14:51:25 2006 for CRE Loaded 6.2 Pro by  doxygen 1.4.4