cod Class Reference

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Definition at line 12 of file cod.php.


Member Function Documentation

cod::after_process (  ) 

Definition at line 91 of file cod.php.

00091                            {
00092     return false;
00093   }

cod::before_process (  ) 

Definition at line 86 of file cod.php.

00086                             {
00087     $this->email_footer='';
00088     return false;
00089   }

cod::check (  ) 

Definition at line 99 of file cod.php.

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

cod::cod (  ) 

Definition at line 19 of file cod.php.

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

cod::confirmation (  ) 

Definition at line 78 of file cod.php.

00078                           {
00079     return false;
00080   }

cod::get_error (  ) 

Definition at line 95 of file cod.php.

00095                        {
00096     return false;
00097   }

cod::install (  ) 

Definition at line 107 of file cod.php.

00107                      {
00108 //     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 ('Paiement à la livraison', 'MODULE_PAYMENT_COD_STATUS', 'True', 'Voulez-vous accepter le paiement &agrave la livraison ?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
00109     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 ('Zone de paiement', 'MODULE_PAYMENT_COD_ZONE', '0', 'Permettre seulement cette méthode de paiement pour la zone choisie.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
00110     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de tri', 'MODULE_PAYMENT_COD_SORT_ORDER', '0', 'Ordre de tri pour l\'affichage (Le plus petit nombre est montré en premier).', '6', '0', now())");
00111     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 ('Etat de la commande', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', '0', 'Sélectionner l\'état de la commande que vous voulez par défault.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
00112   }

cod::javascript_validation (  ) 

Definition at line 65 of file cod.php.

00065                                    {
00066     return false;
00067   }

cod::keys (  ) 

Definition at line 120 of file cod.php.

Referenced by remove().

00120                   {
00121     return array(/*'MODULE_PAYMENT_COD_STATUS',*/ 'MODULE_PAYMENT_COD_ZONE', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', 'MODULE_PAYMENT_COD_SORT_ORDER');
00122   }

cod::pre_confirmation_check (  ) 

Definition at line 74 of file cod.php.

00074                                     {
00075     return false;
00076   }

cod::process_button (  ) 

Definition at line 82 of file cod.php.

00082                             {
00083     return false;
00084   }

cod::remove (  ) 

Definition at line 114 of file cod.php.

00114                     {
00115     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
00116   }

cod::selection (  ) 

Definition at line 69 of file cod.php.

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

cod::update_status (  ) 

Definition at line 36 of file cod.php.

Referenced by cod().

00036                            {
00037     global $order;
00038 
00039     if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_COD_ZONE > 0) ) {
00040       $check_flag = false;
00041       $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'] . "' OR zone_country_id ='0') order by zone_id");
00042       while ($check = tep_db_fetch_array($check_query)) {
00043         if ($check['zone_id'] < 1) {
00044           $check_flag = true;
00045           break;
00046         } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
00047           $check_flag = true;
00048           break;
00049         }
00050       }
00051 
00052       if ($check_flag == false) {
00053         $this->enabled = false;
00054       }
00055     }
00056 
00057 // disable the module if the order only contains virtual products
00058     if ($this->enabled == true) {
00059       if ($order->content_type == 'virtual') {
00060         $this->enabled = false;
00061       }
00062     }
00063   }


Member Data Documentation

cod::$code

Definition at line 13 of file cod.php.

cod::$description

Definition at line 15 of file cod.php.

cod::$enabled

Definition at line 16 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: