ECSHOP 订单列表增加订单产品缩略图

2015-07-26 浏览:1670
ECSHOP 订单列表增加订单产品缩略图
评论:(0)复制地址

 

先上效果图吧

原来的样子

 

打开user.php

 

$orders = get_user_orders($user_id, $pager['size'], $pager['start']);

 

 //把订单的详细内容查询出来 
if(is_array($orders) && count($orders) > 0) { 
        $order_ids = ''; 
        $new_orders = array(); 
        foreach($orders as $val) { 
                $order_ids .= $val['order_id'].','; 
        } 
        $order_ids = substr($order_ids,0,-1); 
 
        $goods_info = array(); 
        $sql = "SELECT o.*,g.goods_thumb FROM ".$ecs->table('order_goods')." o LEFT JOIN ".$ecs->table('goods')." g ON(o.goods_id=g.goods_id) WHERE order_id IN($order_ids)"; 
        $result = $db->query($sql); 
        while($row = $db->fetch_array($result)) { 
                $goods_info[$row['order_id']][] = $row; 
        } 
 
        foreach($orders as $key=>$val) { 
                $val['goods'] = $goods_info[$val['order_id']]; 
                $val['goods_number'] = count($goods_info[$val['order_id']]); 
                $new_orders[] = $val; 
        } 
        $orders = & $new_orders; 
}


修改模板user_transaction.dwt 

 

找到

<h6>{$lang.label_order}</h6>

把原来的显示订单的那块删除 改为如下内容

<!--
.mod1 span {
        display:inline;
        width: auto;
        height: auto;
        position: static;
        overflow: visible;
}
 
.pagebar {
        padding: 0 10px 0 0;
        text-align: right;
}
-->
<div class="main-wrap">
<table id="J_BoughtTable" class="bought-table">
<colgroup>
<col class="selector"></col>
<col class="baobei"></col>
<col class="price"></col>
<col class="quantity"></col>
<col class="after-service"></col>
<col class="amount"></col>
<col class="trade-status"></col>
<col class="operate"></col>
<col class="other"></col>
        </colgroup>
<thead>
<tr class="col-name">
<th></th>
<th class="baobei">宝贝</th>
<th class="price">单价(元)</th>
<th class="quantity">数量</th>
<th class="after-service">售后</th>
<th class="amount">实付款(元)</th>
<th class="trade-status">
<div class="trade-status">
                        交易状态</div></th>
<th class="remark">交易操作</th>
<th class="other">其它操作</th>
</tr>
</thead>
<!--{foreach from=$orders item=item}-->
<tbody class=" xcard">
<tr class="sep-row">
<td colspan="9"></td>
</tr>
<tr class="order-hd">
<td style="padding-left: 5px;" colspan="9">
         <span class="no">
         <label>
                <a href="user.php?act=order_detail&amp;order_id={$item.order_id}">订单编号:<span class="order-num">{$item.order_sn}</span></a>
         </label>
         </span>
         <span class="deal-time">成交时间:{$item.order_time}</span></td>
</tr>
<!--{foreach from=$item.goods item=goods_info name=foo}-->
<tr id="item{$goods_info.goods_id}" class="order-bd &lt;!--{if $item.goods_number &gt; 0 &amp;&amp; $smarty.foreach.foo.iteration == $item.goods_number}--&gt;last&lt;!--{/if}--&gt;">
<td class="baobei" colspan="2">
                <a class="pic s50" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}"><img src="{$goods_info.goods_thumb}" alt="查看宝贝详情" /></a>
<div class="desc">
                <a class="baobei-name" href="/shop/goods.php?id={$goods_info.goods_id}">{$goods_info.goods_name}</a>
                <!--
<div class="spec"><span>颜色分类: **</span><span>参考身高: 均码 0-18月</span></div>
--></div></td>
<td class="price" title="{$goods_info.goods_price}">{$goods_info.goods_price}</td>
<td class="quantity" title="{$goods_info.goods_number}">{$goods_info.goods_number}</td>
<td class="after-service">
                        <a class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" href="javascript:void(0)">申请售后</a>
                        <a class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" href="javascript:void(0)">投诉卖家</a></td>
<!--{if $smarty.foreach.foo.iteration == 1}-->
<td class="amount" rowspan="{$item.goods_number}">
                        <strong>{$item.total_fee}</strong>
 
<!-- (含免运费:0.00 ) -->
 
                        <!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png" mce_src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png" />--></td>
<td class="trade-status" rowspan="{$item.goods_number}">
                        <a class="J_MakePoint status success" href="#">{$item.order_status}</a>
                        <span>
 
                        <a class="detail-link J_MakePoint" href="user.php?act=order_detail&amp;order_id={$item.order_id}">订单详情</a>
                        </span>
                        <!--<a href="#" mce_href="#" class="view-logistics J_MakePoint"">查看物流</a>--></td>
<td class="operate" colspan="2" rowspan="{$item.goods_number}">
                        <!--
                        <span class="skin-white">
                                <a href="#" mce_href="#" class="small-btn J_MakePoint button">评价</a>
                        </span>
 
                        <a class="J_DelOrder J_MakePoint" href="javascript:void(0)" mce_href="javascript:void(0)">删除</a>
                        <a class=" J_MakePoint" href="#" mce_href="#">备忘</a>
<div class="J_ShareSNS sns-share">
                                <a href="#" mce_href="#" class="J_MakePoint">分享</a></div>
-->
                        {$item.handler}</td>
<!--{/if}--></tr>
<!--{/foreach}--></tbody>
<!--{/foreach}-->
<tfoot>
<tr class="sep-row">
<td colspan="9"></td>
</tr>
<tr class="** skin-gray">
<td colspan="3"></td>
<td class="page-nav-cell" colspan="6">
                <!-- #BeginLibraryItem "/library/pages.lbi" --><!-- #EndLibraryItem --></td>
</tr>
</tfoot>
</table>
</div>

 

样式表文件

 http://miaojingyun.com/zb_users/upload/2015/7/for_order.zip

 

 

评论:(0)复制地址
发布:苗景云 | 分类:IT技术&设计 | Tags:ECshop

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。