[ 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_tax.php (source)

   1  <?php
   2  /*
   3    $Id: ot_tax.php,v 1.14 2003/02/14 05:58:35 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_tax {
  14      var $title, $output;
  15  
  16      function ot_tax() {
  17        $this->code = 'ot_tax';
  18        $this->title = MODULE_ORDER_TOTAL_TAX_TITLE;
  19        $this->description = MODULE_ORDER_TOTAL_TAX_DESCRIPTION;
  20        $this->enabled = ((MODULE_ORDER_TOTAL_TAX_STATUS == 'true') ? true : false);
  21        $this->sort_order = MODULE_ORDER_TOTAL_TAX_SORT_ORDER;
  22  
  23        $this->output = array();
  24      }
  25  
  26      function process() {
  27        global $order, $currencies;
  28  
  29        reset($order->info['tax_groups']);
  30        while (list($key, $value) = each($order->info['tax_groups'])) {
  31          if ($value > 0) {
  32            $this->output[] = array('title' => $key . ':',
  33                                    'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
  34                                    'value' => $value);
  35          }
  36        }
  37      }
  38  
  39      function check() {
  40        if (!isset($this->_check)) {
  41          $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TAX_STATUS'");
  42          $this->_check = tep_db_num_rows($check_query);
  43        }
  44  
  45        return $this->_check;
  46      }
  47  
  48      function keys() {
  49        return array('MODULE_ORDER_TOTAL_TAX_STATUS', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER');
  50      }
  51  
  52      function install() {
  53        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 Tax', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', 'Do you want to display the order tax value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
  54        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_TAX_SORT_ORDER', '3', 'Sort order of display.', '6', '2', now())");
  55      }
  56  
  57      function remove() {
  58        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  59      }
  60    }
  61  ?>


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