账号通
    

账号  

密码  

1089

查看

0

回复
主题:[分享]我来分享点干货哈—“x1.0修复商城商品提示错误无法再次购买以及单个商品ip限制购买的规则无效” [收藏主题]  
zlr2113 当前离线

107

主题

4

广播

1

粉丝
添加关注
级别:一年级

用户积分:1222 分
登录次数:293 次
注册时间:2012/1/1
最后登录:2016/12/10
zlr2113 发表于:2015/11/7 9:57:20   | 显示全部帖子 查看该作者主题 楼主 
做在线知识付费 选科汛云开店
这是官方的一个bug在最新版本x1.5不知道解决了没,在下不知。这段代码如果涉及商业版的代码请官方收录bug后删除。
查找相应的文件的,修复bug购买错误即时删除在购物车中该商品

具体是在相应的购物车提示前及时删除清空购物车


  1. Conn.Execute("Delete From KS_ShoppingCart Where flag=0 and Proid=" & RS("id") & " And username='" & GetUserID & "'")'修复bug购买错误即时删除在购物车中该商品



单个商品ip限制购买的规则无效的修改

  1. 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
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.07813秒 powered by KesionCMS 9.0