Ecshop发货查询显示的不友好,有的店主向清如许提出要对齐对行更改,二次开发改成,可以显示出最新生成的订单以及显示发货状态。店家说,这样比较利于用户了解网店。
提出的要求如下:
福建林客户2010102429199未发货
上海赵客户2010091365194未发货
吉林c客户2010090811592未发货
上海赵客户2010073196192未发货
河南张客户2010071153880已发货
北京钟客户2010062744699已发货
显示为这种样式。
清如许工作室,专业Ecshop二次开发,有两年开发经验曾为www.join-2008.com 助人商城开发,高仿京东商城的所有功能。
我说下这个的修改方法:
1,修改 index.php
index_get_invoice_query() 函数
/*------------------------------------------------------ */
//-- PRIVATE FUNCTIONS
/*------------------------------------------------------ */
/**
* 调用发货单查询
* 清如许二次开发,修改显示。
* @access private
* @return array
*/
function index_get_invoice_query()
{
$sql = 'SELECT o.order_sn, o.invoice_no,o.consignee,o.address,o.shipping_status, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' .
" ".'ORDER BY shipping_time DESC LIMIT 10';
$all = $GLOBALS['db']->getAll($sql);
foreach ($all AS $key => $row)
{
$plugin = ROOT_PATH . 'includes/modules/shipping/' . $row['shipping_code'] . '.php';
if (file_exists($plugin))
{
include_once($plugin);
$shipping = new $row['shipping_code'];
$all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']);
}
//清如许修改代码
//utf-8 编码截取
$all[$key]['consignee']=substr($row['consignee'],0,3);
$all[$key]['address']=substr($row['address'],0,6);
switch($row['shipping_status'])
{
case 1: $all[$key]['shipping_status']='已发货'; break;
case 2: $all[$key]['shipping_status']='收货中'; break;
case 3: $all[$key]['shipping_status']='配货中'; break;
case 4: $all[$key]['shipping_status']='已发货'; break;
case 5: $all[$key]['shipping_status']='发货中'; break;
case 0: $all[$key]['shipping_status']='未发货'; break;
}
}
clearstatcache();
return $all;
}
2,修改模板配置文件 invoice_query.lbi
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--{if $invoice_list}-->
<style type="text/css">.boxCenterList form{display:inline;}.boxCenterList form a{color:#404040; text-decoration:underline;}</style>
<div class="box">
<div class="box_1">
<h3><span>发货查询</span></h3>
<div style="line-height: 26px; padding-left: 6px; padding-right: 6px;" class="boxCenterList">
<!-- 发货单查询{foreach from=$invoice_list item=invoice} -->
{$invoice.address}{$invoice.consignee}客户{$invoice.order_sn}{$invoice.shipping_status}<br>
<!-- 结束发货单查询{/foreach}-->
</div></div>
</div>
<div class="blank5"></div>
<!-- {/if} -->
即可,Ecshop二次开发,PHP项目,PHP网站开发,功能订制。清如许工作室
- 上一篇:北京PHP项目开发外包
- 下一篇:php开发网银在线错误问题200903