<%
dim proId,qtn,act
act=Request("act") '根据act的值,来判断采取什么过程.
proId=Request("proId") 'productID
qtn=Request("qtn") 'Quantity
if act="mod" then '修改商品数量
call uCart.ModifItem(proId,qtn,2)
elseif act="del" then '删除某个商品
call uCart.DelItem(proId)
elseif act="clearAll" then '清空购物车
call uCart.RemoveAll()
end if
If uCart.CheckItem(proId)=False and act="add" Then '添加产品进行判定,防止刷新页面增加商品
set rs = Server.CreateObject("adodb.recordset")
rs.open "select goods_name,market_price,shop_price,goods_img from t_goods where goods_id="&proId,conn,1,1
if not rs.eof then
call uCart.AddItem(proId,rs("goods_name"),rs("market_price"),rs("shop_price"),0,qtn,rs("goods_img"))
end if
rs.close
set rs=nothing
end if
myCart=uCart.ViewCart() '查看购物车里详细信息
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DEF3C8">
<tr>
<td width="11%" height="30" align="center" class="font_14hei">图片</td>
<td width="19%" align="center" class="font_14hei">商品名称</td>
<td width="20%" align="center" class="font_14hei">销售价格</td>
<td width="20%" align="center" class="font_14hei">优惠价格</td>
<td width="10%" align="center" class="font_14hei">数量</td>
<td width="10%" align="center" class="font_14hei">金额</td>
<td width="10%" align="center" class="font_14hei">操作</td>
</tr>
<%
For i=LBound(myCart,2) To UBound(myCart,2)
If myCart(0,i)<>"" Then '以前的判断语句
%>
<form name="form1" method="post" action="?act=mod">
<tr>
<td height="30" align="center" bgcolor="#FFFFFF"><img src="<%= myCart(6,i) %>" width="98" height="103" /></td>
<td align="center" bgcolor="#FFFFFF" class="font_12lvse"><%= myCart(1,i) %></td>
<td align="center" bgcolor="#FFFFFF">¥<%= myCart(2,i) %></td>
<td align="center" bgcolor="#FFFFFF">¥<%= myCart(3,i) %></td>
<td align="center" bgcolor="#FFFFFF"><input name="qtn" type="text" value="<%= myCart(5,i) %>" size="2" οnkeyup="this.value=this.value.replace(/\D/g,'')" />
<input type="hidden" name="proId" value="<%= myCart(0,i) %>" />
<input type="submit" value="修改" /></td>
<td align="center" bgcolor="#FFFFFF">¥<% Response.Write(myCart(5,i)*myCart(3,i)) %></td>
<td align="center" bgcolor="#FFFFFF"><a href="?act=del&proId=<%= proId %>">删除</a></td>
</tr>
</form>
<%
End If
Next
if uCart.CheckEmtpy then Response.Write("<td colspan='7' align='center'>暂无购买商品,请继续 <a href='product.asp' style='color:red'>购物</a></td>")
myprice=uCart.TPrice() '得到商品总金额
%>
</table>
<p style="margin-top:5px;">
<input type="button" value="继续购物" οnclick="window.location.href='product.asp';" />
<input type="button" value="清空购物车" οnclick="window.location.href='?act=clearAll';" />
<span style="margin-left:500px;">商品总额:¥<%
if uCart.CheckEmtpy then '检查购物车是否为空
Response.Write(0)
else
Response.Write(myprice(1))
end if
%></span>
<input type="button" value="去结算" style="margin-left:10px;" οnclick="window.location.href='order1.asp';" />
</p>
详细解决方案
asp shopping cart
热度:11 发布时间:2023-12-13 15:52:41.0
相关解决方案
- shopping cart用什么开发比较简单?
- 干电子商务网站,有用过的zen-cart opencart oscommerce ecshop的,哪一个好
- 有没人用过zen cart 做2次开发的,该如何处理
- 关于zen cart···解决思路
- zen-cart session 该如何设置
- eclipse中 起动tomcat时报Multiple Contexts have a path of "/shopping"
- zen-cart 安装了一天都没有搞定,实在是太菜了小弟我
- 干电子商务网站,有用过的zen-cart opencart oscommerce ecshop的,哪一个好
- 有没人用过zen cart 做2次开发的,该如何处理
- docker容器创建的mysql删除cart数据库时报1010 - Error dropping database (can‘t rmdir ‘./cart‘, errno: 39)
- PAT甲级-1044 Shopping in Mars (25分)
- 【乱搞】[Atcoder Grand Contest 022 ]D Shopping
- CF1592B Hemose Shopping
- 万字详解决策树之ID3、CART、C4.5【原理+实例+代码实现】
- ID3、C4.5、CART、GBDT、XGBoost、RF、AdaBoost等模型原理及联系
- 英语话题 Shopping
- Patrick and Shopping
- 【pat-甲级】1044 Shopping in Mars (25分)
- asp shopping cart
- [PAT A1044]Shopping in Mars
- 机器篇——决策树(四) 细说?CART 算法
- 机器学习算法拾遗:(二)决策树(ID3, C4.5, CART)
- 决策树—ID3、C4.5、CART
- 以这个 cart 模块为例,分解一下每个工具类型得到的结果:
- 1044 Shopping in Mars(25 分)(二分容器pair)
- CART 分类 回归
- 决策树算法原理(下) - CART
- hdu - 3264 - Open-air shopping malls(二分 + 圆面积交)
- poj - 1170 - Shopping Offers(状态压缩dp)
- Decision Tree 决策树 - ID3, C45, C50, CART...