ecshop用户中心订单详情增加快递单物流信息查询显示的功能

1,themesdefaultuser_transaction.dwt

找到:

<!--{if $action eq order_detail} -->

在下面一行加入:

<style>
.result-box{background-color:#fff;overflow:hidden;font-family:Tahoma,Arial,sans-serif;font-size:12px;border:1px solid #b9d0f0;line-height:24px}
.result-box table{width:100%;border-collapse:collapse;border-spacing:0}
.result-box table td{height:30px;color:#333;border-bottom:1px solid #e3e3e3}
.result-box table .tr1 td{color:#ff6c00}
.result-box table .td1{width:130px;padding:0 10px;line-height:30px}
.result-box table .td2{padding:0;overflow:hidden}
.result-box table .td2 span{display:block;width:380px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.result-box table .td2 strong{margin-left:5px;padding:0 1px;font-size:10px;color:#fff;background-color:#f00}
</style>
<!-- {if $order.invoice_no}-->
<h5><span>物流跟踪</span></h5>
<div class="blank"></div>
<div class="result-box">
<table>
<tbody id="retData"></tbody>
</table>
</div>
<div class="blank"></div>
<!--{/if}-->

继续查找:

{$order.invoice_no}

在它前面加入 id="invoice_no" ,方便下面抓取“发货单”

继续查找

{$order.shipping_name}

在页面最后的

<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->

下面一行增加:

<script language="javascript">
    document.getElementById("retData").innerHTML="<center>正在查询物流信息,请稍后...</center>";
    var expressid = document.getElementById("shipping_name").innerHTML;
    var expressno = document.getElementById("invoice_no").innerHTML;
    Ajax.call('./plugins/kuaidi100/kuaidi100_post.php?com='+ expressid+'&nu=' + expressno,'showtest=showtest', function(data){document.getElementById("retData").innerHTML=data;}, 'GET', 'TEXT');
</script>

2,includeslib_transaction.php

找到

$order['invoice_no'] = $shipping->query($order['invoice_no']);

把它注释。

3,把插件文件放到 plugins 文件夹下。

打包下载:http://d.16css.com/d/file/ecshop/201501/5c9f5f4b3eef4dda182f269f41f1ddc2.zip

转载:http://www.16css.com/ecshop/1145.html

原文地址:https://www.cnblogs.com/wawahaha/p/4620475.html