📄 ot_cod_fee.php
字号:
<?php
/**
* ot_cod_fee order-total module
*
* @package orderTotal
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @copyright Portions Copyright (c) 2002 Thomas Pl鋘kers http://www.oscommerce.at
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: ot_cod_fee.php 3069 2006-02-27 04:24:54Z ajeh $
*/
/**
* COD-FEE Order Totals Module
*
*/
class ot_cod_fee {
var $title, $output;
function ot_cod_fee() {
$this->code = 'ot_cod_fee';
$this->title = MODULE_ORDER_TOTAL_COD_TITLE;
$this->description = MODULE_ORDER_TOTAL_COD_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_COD_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_COD_SORT_ORDER;
$this->output = array();
}
function process() {
global $order, $currencies, $cod_cost, $cod_country, $shipping;
if (MODULE_ORDER_TOTAL_COD_STATUS == 'true') {
//Will become true, if cod can be processed.
$cod_country = false;
//check if payment method is cod. If yes, check if cod is possible.
if ($_SESSION['payment'] == 'cod') {
//process installed shipping modules
if (substr_count($_SESSION['shipping']['id'], 'flat') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
if (substr_count($_SESSION['shipping']['id'], 'free') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREE);
if (substr_count($_SESSION['shipping']['id'], 'freeshipper') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREESHIPPER);
if (substr_count($_SESSION['shipping']['id'], 'freeoptions') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREEOPTIONS);
if (substr_count($_SESSION['shipping']['id'], 'item') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
if (substr_count($_SESSION['shipping']['id'], 'perweightunit') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_PERWEIGHTUNIT);
if (substr_count($_SESSION['shipping']['id'], 'table') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
if (substr_count($_SESSION['shipping']['id'], 'ups') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPS);
if (substr_count($_SESSION['shipping']['id'], 'usps') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_USPS);
if (substr_count($_SESSION['shipping']['id'], 'fedex') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FEDEX);
if (substr_count($_SESSION['shipping']['id'], 'zones') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
if (substr_count($_SESSION['shipping']['id'], 'ap') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_AP);
if (substr_count($_SESSION['shipping']['id'], 'dp') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DP);
//satt inn av Pompel
if (substr_count($_SESSION['shipping']['id'], 'servicepakke') !=0) $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_SERVICEPAKKE);
for ($i = 0; $i < count($cod_zones); $i++) {
if ($cod_zones[$i] == $order->delivery['country']['iso_code_2']) {
$cod_cost = $cod_zones[$i + 1];
$cod_country = true;
//print('match' . $i . ': ' . $cod_cost);
break;
} elseif ($cod_zones[$i] == '00') {
$cod_cost = $cod_zones[$i + 1];
$cod_country = true;
//print('match' . $i . ': ' . $cod_cost);
break;
} else {
//print('no match');
}
$i++;
}
} else {
//COD selected, but no shipping module which offers COD
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -