天猫购物车里的商品多长时间更新一次

天猫购物车里的商品多长时间更新一次,第1张

只要你不手动咐卜去更新,否则它是不会自动更新的。

除非一些辩梁商品下架了,或者卖完了,就会变成失效商品,变灰到购物车底端衡灶穗。但是商品价格变化之类的,你只要刷新它就会显示最新价格。

//向购物车中添加商品,如州拆果购物车中已经存在该商品,则商品数量加1,如果是第一次购买,则向购物车中添加一条商品信息

if(!IsPostBack)

{

string P_str_CartID = Session["member"].ToString() 会员id

int P_str_GoodsID =Convert.ToInt32(Request["id"]) 产品id

DataSet ds = DB.CheckMember("select count(*) from ShoppingCar where CartID='"+ P_str_CartID+ "'耐启 and GoodsID=" + P_str_GoodsID)

if (ds.Tables[0].Rows[0][0].ToString() == "0")

{

DataSet ds1 = DB.CheckMember("select pro_name,pro_price from Product where id=" + P_str_GoodsID)

string P_str_GoodsName = ds1.Tables[0].Rows[0][0].ToString()

string P_str_GoodsPrice = ds1.Tables[0].Rows[0][1].ToString()

string P_str_Num = "1"

DB.ExSql("insert into ShoppingCar(CartID,GoodsID,GoodsName,GoodsPrice,GoodNum) values('" + P_str_CartID + "'," + P_str_GoodsID + ",'" + P_str_GoodsName + "'," + P_str_GoodsPrice + "," + P_str_Num + ")")

}

else

{

DB.ExSql("update ShoppingCar set GoodNum=GoodNum+1 where CartID='" + P_str_CartID + "' and GoodsID=" + P_str_GoodsID)

}

Bind()//显示购物车中的所册亩枣有商品信息

}

这个是我写的 你可以参考下


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11972653.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存