當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。