修复ecshop订单打印无法显示省市地区的问题

近日一客户反映过来,订单打印的地区信息当中,居然不显示省市地区信息,很是悲剧。到网上搜索了下, 关于ECSHOP此问题的帖子不在少数,总结下,修正如下:这个问题ecshop模板堂解决了,通过修改代码。下面是解决方法:打开admin/order.php,找到第411行,将以下代码:$region = $db->getAll("SELECT region_id, region_name FROM " . $ecs->table("region") . " WHERE region_id IN ($region_id)");复制代码改为:$region = $db->getAll("SELECT region_id, region_name FROM " . $ecs->table("region"));复制代码这是一种修正方法,但是不完美,建议以下:打开admin/order.php , 约在 406行的位置$region_id = !empty($_CFG['shop_country']) ? $_CFG['shop_country'] . ',' : '';$region_id .= !empty($_CFG['shop_province']) ? $_CFG['shop_province'] . ',' : '';$region_id .= !empty($_CFG['shop_city']) ? $_CFG['shop_city'] . ',' : '';$region_id = substr($region_id, 0, -1);$region = $db->getAll("SELECT region_id, region_name FROM " . $ecs->table("region") . " WHERE region_id IN ($region_id)");复制代码调整成:$region_id = !empty($_CFG['shop_country']) ? $_CFG['shop_country'] . ',' : '';$region_id .= !empty($_CFG['shop_province']) ? $_CFG['shop_province'] . ',' : '';$region_id .= !empty($_CFG['shop_city']) ? $_CFG['shop_city'] . ',' : '';$region_id .= !empty($order['country']) ? $order['country'] . ',' : '';$region_id .= !empty($order['province']) ? $order['province'] . ',' : '';$region_id .= !empty($order['city']) ? $order['city'] . ',' : '';$region_id .= !empty($order['district']) ? $order['district'] . ',' : '';$region_id = substr($region_id, 0, -1);$region = $db->getAll("SELECT region_id, region_name FROM " . $ecs->table("region") . " WHERE region_id IN ($region_id)");复制代码其实ECSHOP应该是希望在查询时只读出需要的内容,但忘了加上订单收货人信息下一篇: ecshop最新版下载地址 上一篇: 屏蔽ecshop的SQL报错提示

(0)

相关推荐