ot_tax.php
来自「全新且完善的强大网上商店系统」· PHP 代码 · 共 56 行
PHP
56 行
<?php
class ot_tax {
var $title, $output;
function ot_tax() {
$this->code = 'ot_tax';
$this->title = MODULE_ORDER_TOTAL_TAX_TITLE;
$this->description = MODULE_ORDER_TOTAL_TAX_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_TAX_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_TAX_SORT_ORDER;
$this->output = array();
}
function process() {
global $order, $currencies;
reset($order->info['tax_groups']);
while (list($key, $value) = each($order->info['tax_groups'])) {
if ($value > 0) {
$this->output[] = array('title' => $key . ':',
'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
'value' => $value);
}
}
}
function check() {
global $db,$table_configuration;
if (!isset($this->_check)) {
$check_query = $db->query("select configuration_value from $table_configuration where configuration_key = 'MODULE_ORDER_TOTAL_TAX_STATUS'");
$this->_check = $db->num_rows($check_query);
}
return $this->_check;
}
function keys() {
return array('MODULE_ORDER_TOTAL_TAX_STATUS', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER');
}
function install() {
global $db,$table_configuration;
$db->query("insert into $table_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('显示税', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', '是否列出税?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
$db->query("insert into $table_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('显示顺序', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '3', '排列顺序.', '6', '2', now())");
}
function remove() {
global $db,$table_configuration;
$db->query("delete from $table_configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
}
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?