Home > php教程 > php手册 > 解决ecshop配件价格 优惠套餐价格失效问题 适用京东等模板

解决ecshop配件价格 优惠套餐价格失效问题 适用京东等模板

WBOY
Release: 2016-06-06 20:14:01
Original
1384 people have browsed it

因ecshop模板二次开发的太多了,会出现大小问题。遇到商品详情页的优惠套餐价格失效问题,怎么解决?下面是解决办法,适用京东jd2013等模板。 打开js/common.js文件,找到addToCartNums(goodsId, parentId)方法函数。 整个函数改为如下代码: function addTo

因ecshop模板二次开发的太多了,会出现大小问题。遇到商品详情页的优惠套餐价格失效问题,怎么解决?下面是解决办法,适用京东jd2013等模板。

打开js/common.js文件,找到addToCartNums(goodsId, parentId)方法函数。
整个函数改为如下代码:

function addToCartNums(goodsId, parentId)
{
var goodsIds=goodsId.substr(0,goodsId.length-1).split(‘,’);
var buynum=goodsIds.length-1;
var gid = goodsIds[0];
for(i=0;i {
var goods = new Object();
var spec_arr = new Array();
var fittings_arr = new Array();
var number = 1;
var quick = 1;
goods.quick = quick;
goods.spec = spec_arr;
goods.goods_id = goodsIds[i];
goods.number = 1;
if(i>0){
goods.parent = (typeof(gid) == “undefined”) ? 0 : parseInt(gid);
}

if(i==buynum)
{
Ajax.call(‘flow.php?step=add_to_cart’, ‘goods=’ + goods.toJSONString(), addToCartResponse, ‘POST’, ‘JSON’);
}
else
{
Ajax.call(‘flow.php?step=add_to_cart’, ‘goods=’ + goods.toJSONString(), ”, ‘POST’, ‘JSON’);
}

}
}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template