先上效果图吧
原来的样子
打开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&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 <!--{if $item.goods_number > 0 && $smarty.foreach.foo.iteration == $item.goods_number}-->last<!--{/if}-->">
<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&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
相关文章
ecshop出现Warning: Invalid argument supplied for foreach()错误2019-02-26
Ecshop 分类页产品列表不同分类调用不同产品属性2018-03-08
ECSHOP商品属性调用到任意页面方法2018-03-01
ECSHOP商品列表页显示每个商品的品牌2018-02-28
Ecshop 分类页品牌调用商品数量2018-02-28
ecshop调整默认商品图片排序2018-02-27
ecshop各个页面调用商品销售量方法2016-09-23
ecshop mobile首页循环显示分类及分类下商品2016-09-23
ecshop后台添加虚拟销量以及前台显示销量2016-09-22
ecshop重新导入数据库,管理员和密码正确登录失败2016-09-21