服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > ecshop教程 >

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

时间:2010-11-02 17:10来源: 作者: 点击:
问题描述: 默认的ECSHOP系统,首页发货查询只显示订单号和发货单号,如何将送货地址中的省份+城市+区县 都显示出来呢? 下面是在ECSHOP 2.7.2 官方默认模板基础上的修改教程: 1、 修
问题描述:
默认的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 />


到后台清除缓存后,刷新首页。(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------