国产探花免费观看_亚洲丰满少妇自慰呻吟_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));
     
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永善县| 娱乐| 乳山市| 丰台区| 灵武市| 玛沁县| 仙游县| 县级市| 义马市| 图木舒克市| 冕宁县| 高邮市| 和龙市| 闸北区| 宁强县| 邳州市| 梅河口市| 宜宾市| 永定县| 布尔津县| 密山市| 汝南县| 扶绥县| 邵阳县| 昌邑市| 五河县| 宁河县| 横山县| 唐山市| 息烽县| 张北县| 五华县| 房产| 盘锦市| 卢龙县| 泸水县| 富宁县| 峨眉山市| 拜泉县| 绥中县| 息烽县|