[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/includes/modules/order_total/ -> ot_total.php (source)

   1  <?php
   2  /*
   3    $Id: ot_total.php,v 1.7 2003/02/13 00:12:04 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    class ot_total {
  14      var $title, $output;
  15  
  16      function ot_total() {
  17        $this->code = 'ot_total';
  18        $this->title = MODULE_ORDER_TOTAL_TOTAL_TITLE;
  19        $this->description = MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION;
  20        $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true') ? true : false);
  21        $this->sort_order = MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER;
  22  
  23        $this->output = array();
  24      }
  25  
  26      function process() {
  27        global $order, $currencies;
  28  
  29        $this->output[] = array('title' => $this->title . ':',
  30                                'text' => '<b>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</b>',
  31                                'value' => $order->info['total']);
  32      }
  33  
  34      function check() {
  35        if (!isset($this->_check)) {
  36          $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TOTAL_STATUS'");
  37          $this->_check = tep_db_num_rows($check_query);
  38        }
  39  
  40        return $this->_check;
  41      }
  42  
  43      function keys() {
  44        return array('MODULE_ORDER_TOTAL_TOTAL_STATUS', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER');
  45      }
  46  
  47      function install() {
  48        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 ('Display Total', 'MODULE_ORDER_TOTAL_TOTAL_STATUS', 'true', 'Do you want to display the total order value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
  49        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())");
  50      }
  51  
  52      function remove() {
  53        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  54      }
  55    }
  56  ?>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics