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


PHP shipping_info函数代码示例

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


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

示例1: shipping_info

/**
 * 获取配送插件的实例
 * @param   int   $shipping_id    配送插件ID
 * @return  object     配送插件对象实例
 */
function &get_shipping_object($shipping_id)
{
    $shipping = shipping_info($shipping_id);
    if (!$shipping) {
        $object = new stdClass();
        return $object;
    }
    $file_path = ROOT_PATH . 'includes/modules/shipping/' . $shipping['shipping_code'] . '.php';
    include_once $file_path;
    $object = new $shipping['shipping_code']();
    return $object;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:17,代码来源:lib_order.php

示例2: sys_msg

             /* 显示提示信息 */
             if (!empty($msgs)) {
                 sys_msg(join(chr(13), $msgs), 0, $links);
             } else {
                 ecs_header("Location: order.php?act=info&order_id=" . $order_id . "\n");
                 exit;
             }
         }
     } elseif ('invoice' == $step) {
         /* 如果不存在实体商品,退出 */
         if (!exist_real_goods($order_id)) {
             die('Hacking Attemp');
         }
         /* 保存订单 */
         $shipping_id = $_POST['shipping'];
         $shipping = shipping_info($shipping_id);
         $invoice_no = trim($_POST['invoice_no']);
         $invoice_no = str_replace(',', '<br>', $invoice_no);
         $order = array('shipping_id' => $shipping_id, 'shipping_name' => addslashes($shipping['shipping_name']), 'invoice_no' => $invoice_no);
         update_order($order_id, $order);
         /* todo 记录日志 */
         $sn = $old_order['order_sn'];
         admin_log($sn, 'edit', 'order');
         if (isset($_POST['finish'])) {
             ecs_header("Location: order.php?act=info&order_id=" . $order_id . "\n");
             exit;
         }
     }
 } elseif ($_REQUEST['act'] == 'add' || $_REQUEST['act'] == 'edit') {
     /* 检查权限 */
     admin_priv('order_edit');
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例3: action_insert_update

/**
 * 添加/编辑预售活动的提交
 */
function action_insert_update()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    /* 取得预售活动id */
    $pre_sale_id = intval($_POST['act_id']);
    if (isset($_POST['finish']) || isset($_POST['succeed']) || isset($_POST['fail']) || isset($_POST['mail'])) {
        if ($pre_sale_id <= 0) {
            sys_msg($_LANG['error_pre_sale'], 1);
        }
        $pre_sale = pre_sale_info($pre_sale_id);
        if (empty($pre_sale)) {
            sys_msg($_LANG['error_pre_sale'], 1);
        }
    }
    if (isset($_POST['finish'])) {
        /* 设置活动结束 */
        /* 判断活动状态 */
        if ($pre_sale['status'] != PSS_UNDER_WAY) {
            sys_msg($_LANG['error_status'], 1);
            // 此处怀疑是如果活动进行中突然要结束掉,应该抛出禁止的页面,貌似去掉了,所以程序继续执行
        }
        /* 结束预售活动,修改结束时间为当前时间 */
        $sql = "UPDATE " . $ecs->table('goods_activity') . " SET end_time = '" . gmtime() . "' " . "WHERE act_id = '{$pre_sale_id}' LIMIT 1";
        $db->query($sql);
        /* 清除缓存 */
        clear_cache_files();
        /* 提示信息 */
        $links = array(array('href' => 'pre_sale.php?act=list', 'text' => $_LANG['back_list']));
        sys_msg($_LANG['edit_success'], 0, $links);
    } elseif (isset($_POST['succeed'])) {
        /* 设置活动成功 */
        /* 判断订单状态 */
        if ($pre_sale['status'] != PSS_FINISHED) {
            sys_msg($_LANG['error_status'], 1);
        }
        /* 如果有订单,更新订单信息 */
        if ($pre_sale['total_order'] > 0) {
            /* 查找该预售活动的已确认或未确认订单(已取消的就不管了) */
            $sql = "SELECT order_id " . "FROM " . $ecs->table('order_info') . " WHERE extension_code = '" . PRE_SALE_CODE . "' " . "AND extension_id = '{$pre_sale_id}' " . "AND (order_status = '" . OS_CONFIRMED . "' or order_status = '" . OS_UNCONFIRMED . "')";
            $order_id_list = $db->getCol($sql);
            /* 更新订单商品价 */
            $final_price = $pre_sale['trans_price'];
            $sql = "UPDATE " . $ecs->table('order_goods') . " SET goods_price = '{$final_price}' " . "WHERE order_id " . db_create_in($order_id_list);
            $db->query($sql);
            /* 查询订单商品总额 */
            $sql = "SELECT order_id, SUM(goods_number * goods_price) AS goods_amount " . "FROM " . $ecs->table('order_goods') . " WHERE order_id " . db_create_in($order_id_list) . " GROUP BY order_id";
            $res = $db->query($sql);
            while ($row = $db->fetchRow($res)) {
                $order_id = $row['order_id'];
                $goods_amount = floatval($row['goods_amount']);
                /* 取得订单信息 */
                $order = order_info($order_id);
                /* 判断订单是否有效:余额支付金额 + 已付款金额 >= 保证金 */
                if ($order['surplus'] + $order['money_paid'] >= $pre_sale['deposit']) {
                    /* 有效,设为已确认,更新订单 */
                    // 更新商品总额
                    $order['goods_amount'] = $goods_amount;
                    // 如果保价,重新计算保价费用
                    if ($order['insure_fee'] > 0) {
                        $shipping = shipping_info($order['shipping_id']);
                        $order['insure_fee'] = shipping_insure_fee($shipping['shipping_code'], $goods_amount, $shipping['insure']);
                    }
                    // 重算支付费用
                    $order['order_amount'] = $order['goods_amount'] + $order['shipping_fee'] + $order['insure_fee'] + $order['pack_fee'] + $order['card_fee'] - $order['money_paid'] - $order['surplus'];
                    if ($order['order_amount'] > 0) {
                        $order['pay_fee'] = pay_fee($order['pay_id'], $order['order_amount']);
                    } else {
                        $order['pay_fee'] = 0;
                    }
                    // 计算应付款金额
                    $order['order_amount'] += $order['pay_fee'];
                    // 计算付款状态
                    if ($order['order_amount'] > 0) {
                        $order['pay_status'] = PS_UNPAYED;
                        $order['pay_time'] = 0;
                    } else {
                        $order['pay_status'] = PS_PAYED;
                        $order['pay_time'] = gmtime();
                    }
                    // 如果需要退款,退到帐户余额
                    if ($order['order_amount'] < 0) {
                        // todo (现在手工退款)
                    }
                    // 订单状态
                    $order['order_status'] = OS_CONFIRMED;
                    $order['confirm_time'] = gmtime();
                    // 更新订单
                    $order = addslashes_deep($order);
                    update_order($order_id, $order);
                } else {
                    /* 无效,取消订单,退回已付款 */
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:pre_sale.php

示例4: foreach

     $tips = '您的购物车中没有商品';
 }
 /* 收货人信息 */
 foreach ($consignee as $key => $value) {
     $order[$key] = addslashes($value);
 }
 /* 订单中的总额 */
 $total = order_fee($order, $cart_goods, $consignee);
 $order['bonus'] = $total['bonus'];
 $order['goods_amount'] = $total['goods_price'];
 $order['discount'] = $total['discount'];
 $order['surplus'] = $total['surplus'];
 $order['tax'] = $total['tax'];
 /* 配送方式 */
 if ($order['shipping_id'] > 0) {
     $shipping = shipping_info($order['shipping_id']);
     $order['shipping_name'] = addslashes($shipping['shipping_name']);
 }
 $order['shipping_fee'] = $total['shipping_fee'];
 $order['insure_fee'] = $total['shipping_insure'];
 /* 支付方式 */
 if ($order['pay_id'] > 0) {
     $payment = payment_info($order['pay_id']);
     $order['pay_name'] = addslashes($payment['pay_name']);
 }
 $order['pay_fee'] = $total['pay_fee'];
 $order['cod_fee'] = $total['cod_fee'];
 $order['integral_money'] = $total['integral_money'];
 $order['integral'] = $total['integral'];
 if ($order['extension_code'] == 'exchange_goods') {
     $order['integral_money'] = 0;
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:order.php

示例5: done


//.........这里部分代码省略.........
	    /* 检查商品总额是否达到最低限购金额 */
	    if ($flow_type == CART_GENERAL_GOODS && cart_amount(true, CART_GENERAL_GOODS) < $_CFG['min_goods_amount'])
	    {
			$msg = rpcLang('flow.php', 'goods_amount_not_enough');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	    /* 收货人信息 */
	    foreach ($consignee as $key => $value)
	    {
	        $order[$key] = addslashes($value);
	    }
	
	    /* 订单中的总额 */
	    $total = order_fee($order, $cart_goods, $consignee);
	
	    $order['bonus']        = $total['bonus'];
	    $order['goods_amount'] = $total['goods_price'];
	    $order['discount']     = $total['discount'];
	    $order['surplus']      = $total['surplus'];
	    $order['tax']          = $total['tax'];
	    #购物车中的商品能享受红包支付的总额
	    $discount_amout = compute_discount_amount();
		#红包和积分最多能支付的金额为商品总额
	    $temp_amout = $order['goods_amount'] - $discount_amout;
		if ($temp_amout <= 0)
	    {
	        $order['bonus_id'] = 0;
	    }
	
	    /* 配送方式 */
	    if ($order['shipping_id'] > 0)
	    {
	        $shipping = shipping_info($order['shipping_id']);
	        $order['shipping_name'] = addslashes($shipping['shipping_name']);
	    }
	    $order['shipping_fee'] = $total['shipping_fee'];
	    $order['insure_fee']   = $total['shipping_insure'];
	
	    /* 支付方式 */
	    if ($order['pay_id'] > 0)
	    {
	        $payment = payment_info($order['pay_id']);
	        $order['pay_name'] = addslashes($payment['pay_name']);
	    }
	    $order['pay_fee'] = $total['pay_fee'];
	    $order['cod_fee'] = $total['cod_fee'];
	
	    /* 商品包装 */
	    if ($order['pack_id'] > 0)
	    {
	        $pack               = pack_info($order['pack_id']);
	        $order['pack_name'] = addslashes($pack['pack_name']);
	    }
	    $order['pack_fee'] = $total['pack_fee'];
	
	
	    /* 祝福贺卡 */
	    if ($order['card_id'] > 0)
	    {
	        $card               = card_info($order['card_id']);
	        $order['card_name'] = addslashes($card['card_name']);
	    }
	    $order['card_fee']      = $total['card_fee'];
	
	    $order['order_amount']  = number_format($total['amount'], 2, '.', '');
开发者ID:noikiy,项目名称:mdwp,代码行数:67,代码来源:flow.action.php


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