- 9
- 0
- 约3.94千字
- 约 5页
- 2016-09-21 发布于重庆
- 举报
ecshop更新购物车数量ajax效果
Ecshop更新购物车数量ajax效果
ECSHOP开发中心(68)
?先打开flow.dwt,找到!-- {if $goods.goods_id gt 0 $goods.is_gift eq 0 $goods.parent_id eq 0} 普通商品可修改数量 --,把下面的input框里面的替换成a href=javascript:; onclick=red_num({$goods.rec_id},{$goods.goods_id}); - /ainput type=text name=goods_number[{$goods.rec_id}] id=goods_number_{$goods.rec_id} value={$goods.goods_number} size=4 class=inputBg style=text-align:center onblur=change_price({$goods.rec_id},{$goods.goods_id})/a href=javascript:; onclick=add_num({$goods.rec_id},{$goods.goods_id}) +/a
然后在下一个/td后加一段js代码script type=text/javascript charset=utf-8
function add_num(rec_id,goods_id)
{
document.getElementById(goods_number_+rec_id+).value++
var number = document.getElementById(goods_number_+rec_id+).value;
Ajax.call(flow.php, step=update_group_cartrec_id= + rec_id +number= + number+goods_id= + goods_id, changePriceResp**e, GET, JSON);
}
function red_num(rec_id,goods_id)
{
if (document.getElementById(goods_number_+rec_id+).value1)
{
document.getElementById(goods_number_+rec_id+).value--;
}?
var number = document.getElementById(goods_number_+rec_id+).value;
Ajax.call(flow.php, step=update_group_cartrec_id= + rec_id +number= + number+goods_id= + goods_id, changePriceResp**e, GET, JSON);
}?
function change_price(rec_id,goods_id){
var number = document.getElementById(goods_number_+rec_id+).value;
//alert(number);
Ajax.call(flow.php,step=update_group_cartrec_id= + rec_id +number= + number+goods_id= + goods_id, changePriceResp**e, GET, JSON);
}
function changePriceResp**e(result)
{?
if(result.error?== 1)?{?
alert(result.content);
document.getElementById(goods_number_+result.rec_id+).value =result.number;
}
else
{
document.getElementById(subtotal_+result.rec_id).innerHTML = result.subtotal;//商品总价
document.getElementById(cart_amount_desc).innerHTML = result.cart_amount_desc;//购物车商品总价说明
document.getElementById(market_amount_desc).innerHTML = result.market_amount_desc;//购物车商品总市价说明
}
}
/script
接着把下一行的td align=right bgcolor=#ffffff {$goods.subt
您可能关注的文档
- xp开机启动画面无滚动条或只转一圈.doc
- EC315一元5小时登录设置.docx
- xp操作系统安装.doc
- ECCEDC算法.doc
- xp添加休眠按钮过程.doc
- ECCO变形概念电动汽车.doc
- XP登陆界面修改.doc
- ECC通信模块故障定位的常用命令.doc
- ECDIS综合题1-234.doc
- ECDIS补差理论大纲和实操大纲.doc
- 2025年新外研版三年级上册英语同步教学课件.pptx
- 红十字会大讲堂管理制度.docx
- 技术奇点(Singularity)理论的科学基础、哲学思辨与未来社会构想 _2026年1月.docx
- 公共艺术项目在激活城市消极空间(如高架桥下、废弃铁轨)中的作用 _2026年1月.docx
- “双减”政策对校外培训行业转型及家庭教育投入变化的影响 _2026年1月.docx
- Z世代员工对职场“摸鱼文化”的态度成因与管理对策研究 _2026年1月.docx
- 跨文化团队管理中的沟通障碍、文化冲突与融合策略案例分析 _2026年1月.docx
- 共享经济平台将劳动者归类为“合作伙伴”的伦理与法律责任 _2026年1月.docx
- 大型国际展会(如进博会、CES)的绿色会展实践与可持续发展评估 _2026年1月.docx
- 地理标识产品(如阳澄湖大闸蟹)与产地旅游的融合发展研究 _2026年1月.docx
原创力文档

文档评论(0)