示例#1
0
function calctrueshippingfee2($carrier, $totalweight, $countryname, $orderid)
{
    //根据运输方式,订单总重量,运去的国家,和订单ID,计算打折后的运费 (中国邮政平邮,中国邮政挂号,EUB,EMS)
    //add by Herman.Xi 2012-09-14
    switch ($carrier) {
        case '中国邮政平邮':
            $ordershipfee = calcchinapostpy($totalweight, $countryname);
            break;
        case '中国邮政挂号':
            $ordershipfee = calcchinapostgh($totalweight, $countryname);
            break;
        case 'EUB':
            $ordershipfee = calceub($totalweight, $countryname);
            break;
        case 'EMS':
            $ordershipfee = calcems($totalweight, $countryname);
            break;
        case '香港小包平邮':
        case '香港小包挂号':
        case 'FedEx':
        case 'DHL':
        case 'Global Mail':
            $ordershipfee = calctrueshippingfee($carrier, $totalweight, $countryname, $orderid);
            break;
        default:
            $ordershipfee = 0;
    }
    return round($ordershipfee, 3);
}
示例#2
0
function calctrueshippingfee2($carrier, $totalweight, $countryname, $orderid)
{
    //根据运输方式,订单总重量,运去的国家,和订单ID,计算打折后的运费 (中国邮政平邮,中国邮政挂号,EUB,EMS)
    //add by Herman.Xi 2012-09-14
    switch ($carrier) {
        case '中国邮政平邮':
            $ordershipfee = calcchinapostpy($totalweight, $countryname);
            break;
        case '中国邮政挂号':
            $ordershipfee = calcchinapostgh($totalweight, $countryname);
            break;
        case 'EUB':
            $ordershipfee = calceub($totalweight, $countryname);
            break;
        case 'EMS':
            $ordershipfee = calcems($totalweight, $countryname);
            break;
        case '香港小包平邮':
        case '香港小包挂号':
        case 'Global Mail':
        case 'DHL':
            $ordershipfee = calctrueshippingfee($carrier, $totalweight, $countryname, $orderid);
            break;
        case 'UPS美国专线':
            $ordershipfee = calcupsus($totalweight, $countryname);
            break;
        case 'USPS FirstClass':
        case 'UPS SurePost':
        case 'UPS Ground Commercia':
            $ordershipfee = trans_carriers_fix_get($carrier, $totalweight, $countryname, $zipCode, $transitId);
            break;
        case 'FedEx':
        case '俄速通挂号':
        case '俄速通平邮':
        case '新加坡DHL GM平邮':
        case '新加坡DHL GM挂号':
        case '俄速通大包':
        case '瑞士小包平邮':
        case '瑞士小包挂号':
            $ordershipfee = trans_carriers_fix_get($carrier, $totalweight, $countryname);
            break;
        default:
            $ordershipfee = 0;
    }
    if (in_array($carrier, array('瑞士小包平邮', '瑞士小包挂号', 'USPS FirstClass', 'UPS SurePost', 'UPS Ground Commercia', '俄速通大包', '新加坡DHL GM平邮', '新加坡DHL GM挂号', 'FedEx', '俄速通挂号', '俄速通平邮'))) {
        $ordershipfee = $ordershipfee['fee'];
    }
    return round($ordershipfee, 3);
}