涉及修改文件: 1. \includes\cls_session.php 2. \includes\lib_main.php 详细修改记录: 1. \includes\cls_session.php 第一步:搜索$this->db->query('DELETE FROM ' .$GLOBALS['ecs']->table('cart') . " WHERE session_id ='$this->session_id'"); 只有一处(270行左右),将其修改为 $this->db->query('DELETE FROM ' .$GLOBALS['ecs']->table('cart') . " WHERE session_id ='$this->session_id' AND user_id = 0");//只清空匿名用户的购物车 2. \includes\lib_main.php 第二步:搜索function update_user_info() 27行左右,在该函数内部末尾添加如下代码 /* 更新用户购物车 $sql = "UPDATE " . $GLOBALS['ecs']->table('cart') . " SET". " session_id = '" .SESS_ID . "'". " WHERE user_id = '" .$_SESSION['user_id'] . "'"; $GLOBALS['db']->query($sql); 至此即全部修改完成。
|