您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop线下红包不能支持最小订单的解决方法
林文冲2023-12-23 21:02:51ecshop商城教程已有人查阅
导读线下红包都有个bug,就是线下红包不支持很小订单,无论多小金额的订单都能使用红包。
线下红包都有个bug,就是线下红包不支持很小订单,无论多小金额的订单都能使用红包。
flow.php文件中找到
flow.php文件中找到
/* 验证红包序列号 */
elseif ($_REQUEST['step'] == 'validate_bonus')
{
$bonus_sn = trim($_REQUEST['bonus_sn']);
if (is_numeric($bonus_sn))
{
$bonus = bonus_info(0, $bonus_sn);
}
else
{
$bonus = array();
}
// if (empty($bonus) || $bonus['user_id'] > 0 || $bonus['order_id'] > 0)
// {
// die($_LANG['bonus_sn_error']);
// }
// if ($bonus['min_goods_amount'] > cart_amount())
// {
// die(sprintf($_LANG['bonus_min_amount_error'], price_format($bonus['min_goods_amount'], false)));
// }
// die(sprintf($_LANG['bonus_is_ok'], price_format($bonus['type_money'], false)));
$bonus_kill = price_format($bonus['type_money'], false);
include_once('includes/cls_json.php');
$result = array('error' => '', 'content' => '');
/* 取得购物类型 */
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
/* 获得收货人信息 */
$consignee = get_consignee($_SESSION['user_id']);
/* 对商品信息赋值 */
$cart_goods = cart_goods($flow_type); // 取得商品列表,计算合计
if (empty($cart_goods) || !check_consignee_info($consignee, $flow_type))
{
$result['error'] = $_LANG['no_goods_in_cart'];
}
else
{
/* 取得购物流程设置 */
$smarty->assign('config', $_CFG);
/* 取得订单信息 */
$order = flow_order_info();
if (((!empty($bonus) && $bonus['user_id'] == $_SESSION['user_id']) || ($bonus['type_money'] > 0 && empty($bonus['user_id']))) && $bonus['order_id'] <= 0)
{
//$order['bonus_kill'] = $bonus['type_money'];
$now = gmtime();
if ($now > $bonus['use_end_date'])
{
$order['bonus_id'] = '';
$result['error']=$_LANG['bonus_use_expire'];
}
else
{
$order['bonus_id'] = $bonus['bonus_id'];
$order['bonus_sn'] = $bonus_sn;
}
}
else
{
//$order['bonus_kill'] = 0;
$order['bonus_id'] = '';
$result['error'] = $_LANG['invalid_bonus'];
}
/* 计算订单的费用 */
$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('library/order_total.lbi');
}
$json = new JSON();
die($json->encode($result));
}
修改为
/* 验证红包序列号 */
elseif ($_REQUEST['step'] == 'validate_bonus') '商易专业验证
www.ebingou.cn
{
$bonus_sn = trim($_REQUEST['bonus_sn']);
if (is_numeric($bonus_sn))
{
$bonus = bonus_info(0, $bonus_sn);
}
else
{
$bonus = array();
}
$bonus_kill = price_format($bonus['type_money'], false); '代码号
include_once('includes/cls_json.php');
$result = array('error' => '', 'content' => '');
/* 取得购物类型 */
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
/* 获得收货人信息 */
$consignee = get_consignee($_SESSION['user_id']);
/* 对商品信息赋值 */
$cart_goods = cart_goods($flow_type); // 取得商品列表,计算合计
if (empty($cart_goods) || !check_consignee_info($consignee, $flow_type))
{
$result['error'] = $_LANG['no_goods_in_cart'];
}
else
{
/* 取得购物流程设置 */
$smarty->assign('config', $_CFG);
/* 取得订单信息 */
$order = flow_order_info();
if ($bonus['min_goods_amount'] <= cart_amount())
{
if (((!empty($bonus) && $bonus['user_id'] == $_SESSION['user_id']) || ($bonus['type_money'] > 0 && empty($bonus['user_id']))) && $bonus['order_id'] <= 0)
{
//$order['bonus_kill'] = $bonus['type_money'];
$now = gmtime();
if ($now > $bonus['use_end_date'])
{
$order['bonus_id'] = '';
$result['error']=$_LANG['bonus_use_expire'];
}
else
{
$order['bonus_id'] = $bonus['bonus_id'];
$order['bonus_sn'] = $bonus_sn;
}
}
else
{
//$order['bonus_kill'] = 0;
$order['bonus_id'] = '';
$result['error'] = $_LANG['invalid_bonus'];
}
}
else
{
$result['error'] = sprintf($_LANG['bonus_min_amount_error'], price_format($bonus['min_goods_amount'], false));
}
/* 计算订单的费用 */
$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('library/order_total.lbi');
}
$json = new JSON();
die($json->encode($result));
本文标签:
很赞哦! ()
相关文章
随机图文
-
ecshop文章列表增加文章显示数量的方法
网站根目录下改为 $size = 20; 就行。 这个20的数量就是你显示文章的数量,你可以修改成你觉得满意的数量。 然后到后台点击一下清除缓存。就可以了! -
ecshop首页怎么滚动显示最新订单
ecshop添 加新功能我感觉无外乎就是两个地方的修改,显示的要修改模板,为了方便下次升级,很好都做成lbi,下次升级了直接把lbi拷进去 -
ecshop清空购物车时怎么加上提醒
经常有朋友反应,他们在ecshop购物车中修改数量,点“更新购物车”时,经常不小心点中了“清空购物车”,一下子,所以的产品都没了 -
ecshop关联商品超过50个的修改方法
在ecshop中 的商品详情里,增加关联商品时,最多只能关联50个,那么应该如何解除这个限制呢,其实很简单打开 admin/includes/lib_main.php找到
留言与评论 (共有 条评论) |