1,加到位置

<li class="add_cart_li">
<a href="javascript:addToCart1({$goods.goods_id})" class="btn" id="buy_btn" style="background-color:#f15a28;border:1px solid #f15a28">立即购买</a>
<a href="javascript:addToCart({$goods.goods_id})" class="btn" id="buy_btn"><i class="iconfont">ŭ</i>加入购物车</a>
<a id="fav-btn" class="graybtn" href="javascript:collect({$goods.goods_id})"><i class="iconfont">Ū</i>收藏</a>
</li>

2,js 修改地方

打开js文件加下的common.js文件搜索function addToCart(goodsId, parentId)将这个函数复制一份放到其上方

将函数名改为addToCart1

将Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), addToCartResponse, 'POST', 'JSON');

改为Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), addToCartResponse1, 'POST', 'JSON');

文章来自(www.96net.com.cn)

05-11 17:02