西部数码主机 | 阿里云主机| 虚拟主机 | 服务器 | 返回乐道官网
当前位置: 主页 > php教程 > ecshop教程 >

ecshop详细页增加运费查询(2)

时间:2011-07-23 19:46来源:未知 作者:好模板 点击:
2:js\shopping_flow.js增加以下代码 function get_shipping_list(frm){ data = frm.elements['country'].value + ',' + frm.elements['province'].value + ',' + frm.elements['city'].value + ',' + frm.elem

2:js\shopping_flow.js增加以下代码

 function get_shipping_list(frm){

data = frm.elements['country'].value + ',' + frm.elements['province'].value + ',' +   frm.elements['city'].value + ',' + frm.elements['district'].value;

string = '';

if(frm.elements['country']){

if(frm.elements['country'].value){

string=string+frm.elements['country'].value+',';

}else{

string=string+0+',';

}

}

if(frm.elements['province']){

if(frm.elements['province'].value){

string=string+frm.elements['province'].value+',';

}else{

string=string+0+',';

}

}

if(frm.elements['city']){

if(frm.elements['city'].value){

string=string+frm.elements['city'].value+',';

}else{

string=string+0+',';

}

}

if(frm.elements['district']){

if(frm.elements['district'].value){

string=string+frm.elements['district'].value+',';

}else{

string=string+0+',';

}

}

if(/0,0,0,\d+/.test(string)){//判断是否重新选择,而有最后一个

}else{

var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);

var qty = document.forms['ECS_FORMBUY'].elements['number'].value;

Ajax.call('flow.php', 'step=show_shipping1&string='+string+'&goods_id='+goodsId+'&attr='+attr+ '&number=' + qty, shipping_list_response, "GET", "JSON");

}

}

 

function shipping_list_response(res){

string = res.content;

document.getElementById('show_ship').innerHTML = string;

if(string!=''){

document.getElementById('show_ship').style.display='';

}

}

 

3:goods.php增加以下代码

 

include_once(ROOT_PATH . 'includes/lib_transaction.php');

    include_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/shopping_flow.php');

require(ROOT_PATH . 'includes/lib_order.php');

 

    $smarty->assign('lang',  $_LANG);

$smarty->assign('country_list',       get_regions());

    $smarty->assign('shop_province_list', get_regions(1, $_CFG['shop_country']));

 

(责任编辑:好模板)

顶一下
(7)
63.6%
踩一下
(4)
36.4%
------分隔线----------------------------