在ECSHOP首页的发货查询里显示省市区地址信息
问题描述:
默认的ECSHOP系统,首页发货查询只显示订单号和发货单号,如何将送货地址中的“省份+城市+区县” 都显示出来呢?
下面是在ECSHOP 2.7.2 官方默认模板基础上的修改教程:
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 />