本文整理汇总了PHP中flow_order_info函数的典型用法代码示例。如果您正苦于以下问题:PHP flow_order_info函数的具体用法?PHP flow_order_info怎么用?PHP flow_order_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flow_order_info函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkout
public function checkout () {
global $ecs,$db,$_CFG;
/*------------------------------------------------------ */
//-- 订单确认
/*------------------------------------------------------ */
#取得购物类型
$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)
{
$msg = rpcLang('flow.php', 'no_goods_in_cart');
jsonExit("{\"status\":\"$msg\"}");
}
/*
* 检查用户是否已经登录
* 如果用户已经登录了则检查是否有默认的收货地址
* 如果没有登录则跳转到登录和注册页面
*/
if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0)
{
$msg = rpcLang('user.php', 'nologin');
jsonExit("{\"status\":\"$msg\"}");
}
$consignee = get_consignee($_SESSION['user_id']);
#检查收货人信息是否完整
if (!check_consignee_info($consignee, $flow_type))
{
$msg = rpcLang('flow.php', 'user_address_not_full');
jsonExit("{\"status\":\"$msg\"}");
}
//$_SESSION['flow_consignee'] = $consignee;
#对商品信息赋值
$cart_goods = cart_goods($flow_type); // 取得商品列表,计算合计
/*
$smarty->assign('goods_list', $cart_goods);
#对是否允许修改购物车赋值
if ($flow_type != CART_GENERAL_GOODS || $_CFG['one_step_buy'] == '1')
{
$smarty->assign('allow_edit_cart', 0);
}
else
{
$smarty->assign('allow_edit_cart', 1);
}
#取得购物流程设置
$smarty->assign('config', $_CFG);
*/
/*
* 取得订单信息
*/
$order = flow_order_info();
/* 计算折扣 */
if ($flow_type != CART_EXCHANGE_GOODS && $flow_type != CART_GROUP_BUY_GOODS)
{
$discount = compute_discount();
}
/*
* 计算订单的费用
*/
$total = order_fee($order, $cart_goods, $consignee);
#取得配送列表
$region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
#快递方式集合
$shipping_list = available_shipping_list($region);
#购物车重量
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:mdwp,代码行数:101,代码来源:flow.action.php
示例2: isset
$result['error'] = '您的购物车中没有商品!';
} else {
/* 取得购物类型 */
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
/* 取得购物流程设置 */
$smarty->assign('config', $_CFG);
/* 获得收货人信息 */
$consignee = get_consignee($_SESSION['user_id']);
/* 对商品信息赋值 */
$cart_goods = cart_goods($flow_type);
// 取得商品列表,计算合计
if (empty($cart_goods)) {
$result['error'] = '您的购物车中没有商品!';
} else {
/* 取得订单信息 */
$order = flow_order_info();
$order['surplus'] = $surplus;
/* 计算订单的费用 */
$total = order_fee($order, $cart_goods, $consignee);
$smarty->assign('total', $total);
/* 团购标志 */
if ($flow_type == CART_GROUP_BUY_GOODS) {
$smarty->assign('is_group_buy', 1);
}
$result['content'] = $smarty->fetch('order_total.html');
}
}
$json = new JSON();
die($json->encode($result));
} elseif ($_REQUEST['act'] = 'done') {
/*------------------------------------------------------ */
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:order.php
示例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;
*/
}
开发者ID:fromzyy2ann,项目名称:mescake,代码行数:60,代码来源:order.php
注:本文中的flow_order_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论