[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/modules/order_total/ -> ot_tax.php (source)

   1  <?php
   2  /*

   3  $Id: ot_tax.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   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  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7