修复2.7.3购物BUG,此BUG会导致当团购和普通商品存在购物车时免运费错误!

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家



修复一ECSHOP原有BUG,此BUG会导致当团购(包括其它和普通商品不同的购物类型)和普通商品同时存在购物行为时免运费判断错误!

此BUG当商城存在团购等商品时,购物结算时运费判断会出现较严重影响!

1、flow.php
查找:
// 查看购物车中是否全为免运费商品,若是则把运费赋为零
$sql = 'SELECT count(*) FROM ' . $ecs->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0 AND rec_type = '$flow_type'";
$shipping_count = $db->getOne($sql);

修改为:

// 查看购物车中是否全为免运费商品,若是则把运费赋为零
$sql = 'SELECT count(*) FROM ' . $ecs->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $db->getOne($sql);

2、includes/lib_order.php
查找:
// 查看购物车中是否全为免运费商品,若是则把运费赋为零
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE`session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0 ";
$shipping_count = $GLOBALS['db']->getOne($sql);

修改为

// 查看购物车中是否全为免运费商品,若是则把运费赋为零
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE`session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0AND rec_type = '$flow_type'";
$shipping_count = $GLOBALS['db']->getOne($sql);

//www.lyecs.com 老杨ECSHOP

回答:
这个可能要经常发布团购商品的才有比较大的影响吧。支持一个了。

小错误,顶上去

顶。。。。。。。。。。