首页建站经验 ecshop订单中只要有一个是包邮商品,就整个订单都包邮

ecshop订单中只要有一个是包邮商品,就整个订单都包邮

includes/lib_order.php搜索“查看购物车中是否全为免运费商品,若是则把运费赋为零”,将$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `sessi…

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";

修改为

$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";

再把

$total['shipping_fee'] = ($shipping_count == 0 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);

修改为

$total['shipping_fee'] = ($shipping_count >= 1 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);

即可以实现购物车中只要有一个商品是免邮费的则整个购物车中都免邮。

本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/jianzhan/jingyan/17582.html
上一篇以文件形式缓存php变量的方法
下一篇 替换 WordPress 4.2 中的 Emoji 资源调用
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部