这是官方的一个bug在最新版本x1.5不知道解决了没,在下不知。这段代码如果涉及商业版的代码请官方收录bug后删除。
查找相应的文件的,修复bug购买错误即时删除在购物车中该商品
具体是在相应的购物车提示前及时删除清空购物车
- Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品
单个商品ip限制购买的规则无效的修改
- Sub CheckProductNum(RS)Dim HasMemberBuyNum,HasVisitorBuyNum,MemberNum,visitornum,NowNum,sumMemberNum=KS.ChkClng(RS("MemberNum"))visitornum=KS.ChkClng(RS("VisitorNum"))If MemberNum<>0 Then HasMemberBuyNum=KS.ChkClng(Conn.Execute("select sum(Amount) From KS_OrderItem Where UserIP='"& KS.GetIP &"' and ProID=" & RS("ID") & " AND IsMember=1 and datediff(" & DataPart_D & ",begindate," & SQLNowString & ")<=0")(0))End IfIf visitornum<>0 Then HasVisitorBuyNum=KS.ChkClng(Conn.Execute("select sum(Amount) From KS_OrderItem Where UserIP='"& KS.GetIP &"' and ProID=" & RS("ID") & " AND IsMember=0 and datediff(" & DataPart_D & ",begindate," & SQLNowString & ")<=0")(0))End IfIf KS.C("UserName")<>"" And MemberNum<>0 Then If HasVisitorBuyNum<>0 Then Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 KS.Die "<script>alert('对不起,您已用游客身份购买过["&RS("Title")&"]了,请明天再购买!');history.back(-1)</script>" End If If HasMemberBuyNum>=MemberNum Then Call DelProduct(RS("ID")) Session("ProductList")=ProductList Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位会员每天只能购买" & MemberNum & RS("unit") & "!');history.back(-1);</script>" response.End() ElseIf KS.ChkClng(Session("Amount"&RS("ID")))>MemberNum-HasMemberBuyNum Then sum = MemberNum-HasMemberBuyNum Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位会员每天只能购买" & MemberNum & RS("unit") & ",您只能再购买" & sum & RS("UNIT") &"!');history.back(-1);</script>" response.end ElseIf amount >MemberNum-HasMemberBuyNum Then'单个商品ip限制购买的规则无效的修改 sum = MemberNum-HasMemberBuyNum Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位会员每天只能购买" & MemberNum & RS("unit") & ",您只能再购买" & sum & RS("UNIT") &"!');history.back(-1);</script>" response.end End IfEnd IfIf visitornum<>0 And KS.C("UserName")="" And KS.C("PassWord")="" Then If HasMemberBuyNum<>0 Then Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 KS.Die "<script>alert('对不起,您已用会员身份购买过["&RS("Title")&"]了,请明天再购买!');history.back(-1)</script>" End If If HasVisitorBuyNum>=visitornum Then Call DelProduct(RS("ID")) Session("ProductList")=ProductList Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位游客每天只能购买" & visitornum & RS("unit") & "!');history.back(-1);</script>" response.End() ElseIf KS.ChkClng(Session("Amount"&RS("ID")))>visitornum-HasVisitorBuyNum Then sum = visitornum-HasVisitorBuyNum Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位游客每天只能购买" & MemberNum & RS("unit") & ",您只能再购买" & Session("Amount"&RS("ID")) & RS("UNIT") &"!');history.back(-1);</script>" response.end ElseIf amount >visitornum-HasVisitorBuyNum Then'单个商品ip限制购买的规则无效的修改 sum = visitornum-HasVisitorBuyNum Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品 response.write "<script language=javascript>alert('对不起,["&RS("Title")&"]限制每位游客每天只能购买" & MemberNum & RS("unit") & ",您只能再购买" & Session("Amount"&RS("ID")) & RS("UNIT") &"!');history.back(-1);</script>" response.end End IfEnd If
不懂代码的随时可加我qq问我哈,412635187