本文整理汇总了PHP中order_fee函数的典型用法代码示例。如果您正苦于以下问题:PHP order_fee函数的具体用法?PHP order_fee怎么用?PHP order_fee使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了order_fee函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: done
//.........这里部分代码省略.........
{
$sql = "UPDATE " . $ecs->table('user_bonus') . " SET user_id = '$user_id' WHERE bonus_id = '$bonus[bonus_id]' LIMIT 1";
$db->query($sql);
}
$order['bonus_id'] = $bonus['bonus_id'];
$order['bonus_sn'] = $bonus_sn;
}
}
/* 订单中的商品 */
$cart_goods = cart_goods($flow_type);
if (empty($cart_goods))
{
$msg = rpcLang('flow.php', 'no_goods_in_cart');
jsonExit("{\"status\":\"$msg\"}");
}
/* 检查商品总额是否达到最低限购金额 */
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'];
示例2: cart_goods
}
} else {
$order['surplus'] = 0;
$order['integral'] = 0;
}
/* 订单中的商品 */
$cart_goods = cart_goods($flow_type);
if (empty($cart_goods)) {
$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']);
示例3: get_total_price_in_cart
public static function get_total_price_in_cart()
{
global $db;
global $ecs;
include_once 'includes/lib_order.php';
//取得购物类型
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
//团购标志
if ($flow_type == CART_GROUP_BUY_GOODS) {
//$smarty->assign('is_group_buy', 1);
} elseif ($flow_type == CART_EXCHANGE_GOODS) {
//$smarty->assign('is_exchange_goods', 1);
} else {
//正常购物流程 清空其他购物流程情况
$_SESSION['flow_order']['extension_code'] = '';
}
//检查购物车中是否有商品
$sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') . " WHERE session_id = '" . SESS_ID . "' " . "AND parent_id = 0 AND is_gift = 0 AND rec_type = '{$flow_type}'";
if ($db->getOne($sql) == 0) {
return false;
}
/* 对商品信息赋值 */
$cart_goods = cart_goods($flow_type);
// 取得商品列表,计算合计
$order = flow_order_info();
$order['best_time'] = $_SESSION['flow_consignee']['best_time'];
//计算折扣
if ($flow_type != CART_EXCHANGE_GOODS && $flow_type != CART_GROUP_BUY_GOODS) {
$discount = compute_discount();
$favour_name = empty($discount['name']) ? '' : join(',', $discount['name']);
}
//计算订单的费用
$total = order_fee($order, $cart_goods, $consignee);
return $total;
/*
//蛋糕
$sql = "select * from " . $ecs->table('cart') . " WHERE session_id='" . SESS_ID . "'";
$goods = $db->getAll($sql);
$total = 0;
foreach($goods as $val){
$total += $val['goods_price'] * $val['goods_number'];
}
//餐具
if($_SESSION['extra_fork']==NULL){
//$_SESSION['extra_fork'] = array();
}else{
$forks = $_SESSION['extra_fork'];
foreach ($forks as $value){
$total+=($value*0.5);
}
}
//运费
if($_SESSION['need_shipping_fee']){
$total+=$_SESSION['need_shipping_fee'];
}
return $total;
*/
}