国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Ecshop > 正文

ECSHOP知識線下紅包不能支持最小訂單問題

2024-07-09 22:56:24
字體:
來源:轉載
供稿:網友
線下紅包都有個bug,就是線下紅包不支持最小訂單,無論多小金額的訂單都能使用紅包。
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.kicshop.com
     
    {
     
        $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));
     
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洛川县| 东丰县| 洛南县| 舟山市| 基隆市| 岳阳市| 吴江市| 德阳市| 桓台县| 夏津县| 九江县| 陕西省| 淮阳县| 灌阳县| 诸暨市| 宾阳县| 海晏县| 清水河县| 南木林县| 巴彦县| 凌海市| 兴化市| 庄河市| 邢台县| 临江市| 常州市| 澎湖县| 武山县| 永修县| 德令哈市| 马尔康县| 虹口区| 咸阳市| 如东县| 大邑县| 房产| 梁山县| 辽中县| 宜春市| 永泰县| 洪江市|