购物车的总价

lvwp1992 2013-04-11 10:12:41
<table cellspacing="0" id="products">
<tr>
<th class="product">产品</th>
<th class="price">单价</th>
<th class="count">数量</th>
<!-- <th class="total">小计</th> -->
<th>操作</th>
</tr>
<c:forEach items="${cart }" var="item">

<tr>

<%-- <input type="hidden" name="goodsid" id="goodsid" value="${item.goods.goodsid }"/> --%>
<td id="tp_id" style="display:none">${item.goods.goodsid
}</td>
<td class="product" id="goodsname">${item.goods.goodsname}</td>
<td class="price" id="price">¥<fmt:formatNumber
value="${item.goods.price}" pattern=".00"></fmt:formatNumber>
</td>
<td class="count"><span class="goods_cut"
onclick="goods_cut(${item.goods.goodsid});changePrice();">
<img src="${ initParam.resource }/image/jian.gif" alt="减少"
width="15px" height="15px" /> </span> <input
id="${item.goods.goodsid }count" class="num" type="text"
name="${item.goods.goodsid }count" value="${item.quantity}"
size="2" onblur="changePrice()" /> <span class="goods_add"
onclick="goods_add(${item.goods.goodsid});changePrice();">
<img src="${ initParam.resource }/image/jia.gif" alt="增加"
width="15px" height="15px" /> </span>
</td>
<td id="smalltotal" style="display:none">${item.goods.price
* item.quantity }</td>
<%-- <td class="total" id="total">¥<span id="amount"><fmt:formatNumber
value="${ item.goods.price * item.quantity }" pattern=".00"></fmt:formatNumber>
</span>
</td> --%>
<td class="count"><a href="javascript:void(0);"
onclick="javascript:toDelete(${item.goods.goodsid});">[删除]</a>
<!-- <input type="submit" name="action" value="删除" onclick="javascript:toDelete();"/> -->
</td>

</tr>
</c:forEach>
</table>
<div class="order_total">
<p id="discount" class="discount_tip"> </p>

<strong class="total" id="total">总计:¥ <span id="total"><fmt:formatNumber
value="${smalltotal.smalltotal }" pattern=".00"></fmt:formatNumber> </span> </strong>

</div>
这个总计该怎么算呢
...全文
91 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lvwp1992 2013-04-11
  • 打赏
  • 举报
回复
技术区没分了 发不了该怎么遍历呢 能不能说的具体点 谢谢
rumlee 2013-04-11
  • 打赏
  • 举报
回复
在后台遍历一下,计算好。你应该发到技术区去。

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧