当前位置: 首页>>代码示例>>PHP>>正文


PHP shipping_area_info函数代码示例

本文整理汇总了PHP中shipping_area_info函数的典型用法代码示例。如果您正苦于以下问题:PHP shipping_area_info函数的具体用法?PHP shipping_area_info怎么用?PHP shipping_area_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了shipping_area_info函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: user_info

 }
 /* 取得用户信息 */
 $user = user_info($_SESSION['user_id']);
 /* 用户帐户余额是否足够 */
 if ($surplus > $user['user_money'] + $user['credit_line']) {
     $err->add($_LANG['error_surplus_not_enough']);
     $err->show($_LANG['order_detail'], 'user.php?act=order_detail&order_id=' . $order_id);
 }
 /* 修改订单,重新计算支付费用 */
 $order['surplus'] += $surplus;
 $order['order_amount'] -= $surplus;
 if ($order['order_amount'] > 0) {
     $cod_fee = 0;
     if ($order['shipping_id'] > 0) {
         $regions = array($order['country'], $order['province'], $order['city'], $order['district']);
         $shipping = shipping_area_info($order['shipping_id'], $regions);
         if ($shipping['support_cod'] == '1') {
             $cod_fee = $shipping['pay_fee'];
         }
     }
     $pay_fee = 0;
     if ($order['pay_id'] > 0) {
         $pay_fee = pay_fee($order['pay_id'], $order['order_amount'], $cod_fee);
     }
     $order['pay_fee'] = $pay_fee;
     $order['order_amount'] += $pay_fee;
 }
 /* 如果全部支付,设为已确认、已付款 */
 if ($order['order_amount'] == 0) {
     if ($order['order_status'] == OS_UNCONFIRMED) {
         $order['order_status'] = OS_CONFIRMED;
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:user.php

示例2: action_act_edit_surplus

function action_act_edit_surplus()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    /* 检查是否登录 */
    if ($_SESSION['user_id'] <= 0) {
        ecs_header("Location: ./\n");
        exit;
    }
    /* 检查订单号 */
    $order_id = intval($_POST['order_id']);
    if ($order_id <= 0) {
        ecs_header("Location: ./\n");
        exit;
    }
    /* 检查余额 */
    $surplus = floatval($_POST['surplus']);
    if ($surplus <= 0) {
        $err->add($_LANG['error_surplus_invalid']);
        $err->show($_LANG['order_detail'], 'user.php?act=order_detail&order_id=' . $order_id);
    }
    include_once ROOT_PATH . 'includes/lib_order.php';
    /* 取得订单 */
    $order = order_info($order_id);
    if (empty($order)) {
        ecs_header("Location: ./\n");
        exit;
    }
    /* 检查订单用户跟当前用户是否一致 */
    if ($_SESSION['user_id'] != $order['user_id']) {
        ecs_header("Location: ./\n");
        exit;
    }
    /* 检查订单是否未付款,检查应付款金额是否大于0 */
    if ($order['pay_status'] != PS_UNPAYED || $order['order_amount'] <= 0) {
        $err->add($_LANG['error_order_is_paid']);
        $err->show($_LANG['order_detail'], 'user.php?act=order_detail&order_id=' . $order_id);
    }
    /* 计算应付款金额(减去支付费用) */
    $order['order_amount'] -= $order['pay_fee'];
    /* 余额是否超过了应付款金额,改为应付款金额 */
    if ($surplus > $order['order_amount']) {
        $surplus = $order['order_amount'];
    }
    /* 取得用户信息 */
    $user = user_info($_SESSION['user_id']);
    /* 用户帐户余额是否足够 */
    if ($surplus > $user['user_money'] + $user['credit_line']) {
        $err->add($_LANG['error_surplus_not_enough']);
        $err->show($_LANG['order_detail'], 'user.php?act=order_detail&order_id=' . $order_id);
    }
    /* 修改订单,重新计算支付费用 */
    $order['surplus'] += $surplus;
    $order['order_amount'] -= $surplus;
    if ($order['order_amount'] > 0) {
        $cod_fee = 0;
        if ($order['shipping_id'] > 0) {
            $regions = array($order['country'], $order['province'], $order['city'], $order['district']);
            $shipping = shipping_area_info($order['shipping_id'], $regions);
            if ($shipping['support_cod'] == '1') {
                $cod_fee = $shipping['pay_fee'];
            }
        }
        $pay_fee = 0;
        if ($order['pay_id'] > 0) {
            $pay_fee = pay_fee($order['pay_id'], $order['order_amount'], $cod_fee);
        }
        $order['pay_fee'] = $pay_fee;
        $order['order_amount'] += $pay_fee;
    }
    /* 如果全部支付,设为已确认、已付款 */
    if ($order['order_amount'] == 0) {
        if ($order['order_status'] == OS_UNCONFIRMED) {
            $order['order_status'] = OS_CONFIRMED;
            $order['confirm_time'] = gmtime();
        }
        $order['pay_status'] = PS_PAYED;
        $order['pay_time'] = gmtime();
    }
    $order = addslashes_deep($order);
    update_order($order_id, $order);
    /* 更新用户余额 */
    $change_desc = sprintf($_LANG['pay_order_by_surplus'], $order['order_sn']);
    log_account_change($user['user_id'], -1 * $surplus, 0, 0, 0, $change_desc);
    /* 跳转 */
    ecs_header('Location: user.php?act=order_detail&order_id=' . $order_id . "\n");
    exit;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:93,代码来源:user.php

示例3: merge_order

/**
 * 合并订单
 * @param   string  $from_order_sn  从订单号
 * @param   string  $to_order_sn    主订单号
 * @return  成功返回true,失败返回错误信息
 */
function merge_order($from_order_sn, $to_order_sn)
{
    /* 订单号不能为空 */
    if (trim($from_order_sn) == '' || trim($to_order_sn) == '') {
        return $GLOBALS['_LANG']['order_sn_not_null'];
    }
    /* 订单号不能相同 */
    if ($from_order_sn == $to_order_sn) {
        return $GLOBALS['_LANG']['two_order_sn_same'];
    }
    /* 取得订单信息 */
    $from_order = order_info(0, $from_order_sn);
    $to_order = order_info(0, $to_order_sn);
    /* 检查订单是否存在 */
    if (!$from_order) {
        return sprintf($GLOBALS['_LANG']['order_not_exist'], $from_order_sn);
    } elseif (!$to_order) {
        return sprintf($GLOBALS['_LANG']['order_not_exist'], $to_order_sn);
    }
    /* 检查合并的订单是否为普通订单,非普通订单不允许合并 */
    if ($from_order['extension_code'] != '' || $to_order['extension_code'] != 0) {
        return $GLOBALS['_LANG']['merge_invalid_order'];
    }
    /* 检查订单状态是否是已确认或未确认、未付款、未发货 */
    if ($from_order['order_status'] != OS_UNCONFIRMED && $from_order['order_status'] != OS_CONFIRMED) {
        return sprintf($GLOBALS['_LANG']['os_not_unconfirmed_or_confirmed'], $from_order_sn);
    } elseif ($from_order['pay_status'] != PS_UNPAYED) {
        return sprintf($GLOBALS['_LANG']['ps_not_unpayed'], $from_order_sn);
    } elseif ($from_order['shipping_status'] != SS_UNSHIPPED) {
        return sprintf($GLOBALS['_LANG']['ss_not_unshipped'], $from_order_sn);
    }
    if ($to_order['order_status'] != OS_UNCONFIRMED && $to_order['order_status'] != OS_CONFIRMED) {
        return sprintf($GLOBALS['_LANG']['os_not_unconfirmed_or_confirmed'], $to_order_sn);
    } elseif ($to_order['pay_status'] != PS_UNPAYED) {
        return sprintf($GLOBALS['_LANG']['ps_not_unpayed'], $to_order_sn);
    } elseif ($to_order['shipping_status'] != SS_UNSHIPPED) {
        return sprintf($GLOBALS['_LANG']['ss_not_unshipped'], $to_order_sn);
    }
    /* 检查订单用户是否相同 */
    if ($from_order['user_id'] != $to_order['user_id']) {
        return $GLOBALS['_LANG']['order_user_not_same'];
    }
    /* 合并订单 */
    $order = $to_order;
    $order['order_id'] = '';
    $order['add_time'] = gmtime();
    // 合并商品总额
    $order['goods_amount'] += $from_order['goods_amount'];
    // 合并折扣
    $order['discount'] += $from_order['discount'];
    if ($order['shipping_id'] > 0) {
        // 重新计算配送费用
        $weight_price = order_weight_price($to_order['order_id']);
        $from_weight_price = order_weight_price($from_order['order_id']);
        $weight_price['weight'] += $from_weight_price['weight'];
        $weight_price['amount'] += $from_weight_price['amount'];
        $weight_price['number'] += $from_weight_price['number'];
        $region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
        $shipping_area = shipping_area_info($order['shipping_id'], $region_id_list);
        $order['shipping_fee'] = shipping_fee($shipping_area['shipping_code'], unserialize($shipping_area['configure']), $weight_price['weight'], $weight_price['amount'], $weight_price['number']);
        // 如果保价了,重新计算保价费
        if ($order['insure_fee'] > 0) {
            $order['insure_fee'] = shipping_insure_fee($shipping_area['shipping_code'], $order['goods_amount'], $shipping_area['insure']);
        }
    }
    // 重新计算包装费、贺卡费
    if ($order['pack_id'] > 0) {
        $pack = pack_info($order['pack_id']);
        $order['pack_fee'] = $pack['free_money'] > $order['goods_amount'] ? $pack['pack_fee'] : 0;
    }
    if ($order['card_id'] > 0) {
        $card = card_info($order['card_id']);
        $order['card_fee'] = $card['free_money'] > $order['goods_amount'] ? $card['card_fee'] : 0;
    }
    // 红包不变,合并积分、余额、已付款金额
    $order['integral'] += $from_order['integral'];
    $order['integral_money'] = value_of_integral($order['integral']);
    $order['surplus'] += $from_order['surplus'];
    $order['money_paid'] += $from_order['money_paid'];
    // 计算应付款金额(不包括支付费用)
    $order['order_amount'] = $order['goods_amount'] - $order['discount'] + $order['shipping_fee'] + $order['insure_fee'] + $order['pack_fee'] + $order['card_fee'] - $order['bonus'] - $order['integral_money'] - $order['surplus'] - $order['money_paid'];
    // 重新计算支付费
    if ($order['pay_id'] > 0) {
        // 货到付款手续费
        $cod_fee = $shipping_area ? $shipping_area['pay_fee'] : 0;
        $order['pay_fee'] = pay_fee($order['pay_id'], $order['order_amount'], $cod_fee);
        // 应付款金额加上支付费
        $order['order_amount'] += $order['pay_fee'];
    }
    /* 插入订单表 */
    do {
        $order['order_sn'] = get_order_sn();
        if ($GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), addslashes_deep($order), 'INSERT')) {
            break;
//.........这里部分代码省略.........
开发者ID:dlpc,项目名称:ecshop,代码行数:101,代码来源:lib_order.php

示例4: available_shipping_list

     $shipping_list = available_shipping_list($region_id_list);
     /* 取得配送费用 */
     $total = order_weight_price($order_id);
     foreach ($shipping_list as $key => $shipping) {
         $shipping_fee = shipping_fee($shipping['shipping_code'], unserialize($shipping['configure']), $total['weight'], $total['amount'], $total['number']);
         $shipping_list[$key]['shipping_fee'] = $shipping_fee;
         $shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee);
         $shipping_list[$key]['free_money'] = price_format($shipping['configure']['free_money']);
     }
     $smarty->assign('shipping_list', $shipping_list);
 } elseif ('payment' == $step) {
     /* 取得可用的支付方式列表 */
     if (exist_real_goods($order_id)) {
         /* 存在实体商品 */
         $region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
         $shipping_area = shipping_area_info($order['shipping_id'], $region_id_list);
         $pay_fee = $shipping_area['support_cod'] == 1 ? $shipping_area['pay_fee'] : 0;
         $payment_list = available_payment_list($shipping_area['support_cod'], $pay_fee);
     } else {
         /* 不存在实体商品 */
         $payment_list = available_payment_list(false);
     }
     /* 过滤掉使用余额支付 */
     foreach ($payment_list as $key => $payment) {
         if ($payment['pay_code'] == 'balance') {
             unset($payment_list[$key]);
         }
     }
     $smarty->assign('payment_list', $payment_list);
 } elseif ('other' == $step) {
     /* 查询是否存在实体商品 */
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例5: checkout


//.........这里部分代码省略.........
	    else
	    {
	        $shipping = shipping_info($order['shipping_id']);
	        $cod = $shipping['support_cod'];
	
	        if ($cod)
	        {
	            #如果是团购,且保证金大于0,不能使用货到付款
	            if ($flow_type == CART_GROUP_BUY_GOODS)
	            {
	                $group_buy_id = $_SESSION['extension_id'];
	                if ($group_buy_id <= 0)
	                {
	                    show_message('error group_buy_id');
	                }
	                $group_buy = group_buy_info($group_buy_id);
	                if (empty($group_buy))
	                {
	                    show_message('group buy not exists: ' . $group_buy_id);
	                }
	
	                if ($group_buy['deposit'] > 0)
	                {
	                    $cod = false;
	                    $cod_fee = 0;
	
	                    #赋值保证金
	                    $smarty->assign('gb_deposit', $group_buy['deposit']);
	                }
	            }
	
	            if ($cod)
	            {
	                $shipping_area_info = shipping_area_info($order['shipping_id'], $region);
	                $cod_fee            = $shipping_area_info['pay_fee'];
	            }
	        }
	        else
	        {
	            $cod_fee = 0;
	        }
	    }
	    
	
	    # 给货到付款的手续费加<span id>,以便改变配送的时候动态显示
	    $payment_list = available_payment_list(1, $cod_fee);
	    if(isset($payment_list))
	    {
	        foreach ($payment_list as $key => $payment)
	        {
	            if ($payment['is_cod'] == '1')
	            {
	                $payment_list[$key]['format_pay_fee'] = '<span id="ECS_CODFEE">' . $payment['format_pay_fee'] . '</span>';
	            }
	            #如果有易宝神州行支付 如果订单金额大于300 则不显示
	            if ($payment['pay_code'] == 'yeepayszx' && $total['amount'] > 300)
	            {
	                unset($payment_list[$key]);
	            }
	            #如果有余额支付
	            if ($payment['pay_code'] == 'balance')
	            {
	                #如果未登录,不显示
	                if ($_SESSION['user_id'] == 0)
	                {
	                    unset($payment_list[$key]);
开发者ID:noikiy,项目名称:mdwp,代码行数:67,代码来源:flow.action.php

示例6: array

$shipping_id = $db->getOne($sql);
/* ajax获取运费 */
if ($action == 'get_shipping_fee') {
    require ROOT_PATH . 'includes/cls_json.php';
    $region = array();
    $json = new JSON();
    $result = array('error' => 0, 'message' => '', 'content' => '');
    $_POST['goods'] = strip_tags(urldecode($_POST['goods']));
    $_POST['goods'] = json_str_iconv($_POST['goods']);
    $goods = $json->decode($_POST['goods']);
    $region['country'] = $goods->country;
    $region['province'] = $goods->province;
    $region['city'] = $goods->city;
    $region['district'] = $goods->district;
    $goods_weight = $goods->goods_weight;
    $shipping_info = shipping_area_info($shipping_id, $region);
    $shipping_fee = shipping_fee($shipping_info['shipping_code'], $shipping_info['configure'], $goods_weight, '0', '0');
    $result['content'] = $shipping_fee;
    die($json->encode($result));
}
/* ajax获取运单状态 */
if ($action == 'get_OrderStatus') {
    require ROOT_PATH . 'includes/cls_json.php';
    require ROOT_PATH . 'includes/cls_captcha.php';
    $json = new JSON();
    $result = array('error' => 0, 'message' => '', 'content' => '');
    $_POST['order'] = strip_tags(urldecode($_POST['order']));
    $_POST['order'] = json_str_iconv($_POST['order']);
    $order = $json->decode($_POST['order']);
    $validator = new captcha();
    if (!$validator->check_word($order->captcha)) {
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:kuaidi.php


注:本文中的shipping_area_info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。