广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ECSHOP首页发货查询里显示省市区地址信息

二次开发Ecshop二次开发

二次开发Ecshop二次开发

ECSHOP首页发货查询里显示省市区地址信息

问题描述:
默认的ECSHOP系统,首页发货查询只显示订单号和发货单号,如何将送货地址中的“省份+城市+区县” 都显示出来呢?

下面是在ECSHOP官方默认模板基础上的修改教程:
1、
修改 index.php 文件

$sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
修改为
$sql = 'SELECT o.province,o.city,o.district,o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
2、
继续修改index.php 文件
找到
$all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']);
在它下面增加几行代码
$all[$key]['province']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$row['province']);
$all[$key]['city']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$row['city']);
$all[$key]['district']=$GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id=".$row['district']);
3、修改 /themes/default/library/invoice_query.lbi 文件
找到
{$lang.order_number} {$invoice.order_sn}<br /> 在它下面增加一行模板标签代码

{$invoice.province}-{$invoice.city}-{$invoice.district}<br />

到后台清除缓存后,刷新首页。