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']));
(责任编辑:最模板) |