我的订单增加缩略图 仿淘宝 已买到的宝贝 ecshop二次开发
2013-10-24 00:10
519 查看
先上效果图吧
![](http://laolee.org/uploads/2013/06/%E6%88%91%E7%9A%84%E8%AE%A2%E5%8D%95%E6%94%B9%E8%BF%9B%E5%90%8E.jpg)
原来的样子
![](http://laolee.org/uploads/2013/06/%E6%88%91%E7%9A%84%E8%AE%A2%E5%8D%95%E6%94%B9%E8%BF%9B%E5%89%8D.jpg)
找到
view plaincopy
to clipboardprint?
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
增加如下内容
view plaincopy
to clipboardprint?
//把订单的详细内容查询出来
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
找到
view plaincopy
to clipboardprint?
<h6>{$lang.label_order}</h6>
把原来的显示订单的那块删除 改为如下内容
view plaincopy
to clipboardprint?
{* lee add 2013-6-28 开始 *}
<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css">
<style type="text/css">
.mod1 span {
display:inline;
width: auto;
height: auto;
position: static;
overflow: visible;
}
.pagebar {
padding: 0 10px 0 0;
text-align: right;
}
</style>
<div class="main-wrap">
<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css" media="all">
<table class="bought-table" id="J_BoughtTable" data-spm="9">
<colgroup>
<col class="selector">
<col class="baobei">
<col class="price">
<col class="quantity">
<col class="after-service">
<col class="amount">
<col class="trade-status">
<col class="operate">
<col class="other">
</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 colspan="9" style="padding-left:5px;">
<span class="no">
<label>
<a href="user.php?act=order_detail&order_id={$item.order_id}" title="">订单编号:<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 hidefocus="true" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}" class="pic s50"><img alt="查看宝贝详情" src="{$goods_info.goods_thumb}"></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 href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">申请售后</a>
<a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">投诉卖家</a>
</td>
<!--{if $smarty.foreach.foo.iteration == 1}-->
<td class="amount" rowspan="{$item.goods_number}">
<strong>{$item.total_fee}</strong>
<p class="post-type"><!-- (含免运费:0.00 ) -->
<!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png"/>-->
</p></td>
<td class="trade-status" rowspan="{$item.goods_number}">
<a href="#" class="J_MakePoint status success">{$item.order_status}</a>
<span>
<span class="uinfo-icon"></span>
<a href="user.php?act=order_detail&order_id={$item.order_id}" class="detail-link J_MakePoint">订单详情</a>
</span>
<!--<a href="#" class="view-logistics J_MakePoint"">查看物流</a>-->
</td>
<td class="operate" rowspan="{$item.goods_number}" colspan="2">
<!--
<span class="skin-white">
<a href="#" class="small-btn J_MakePoint button">评价</a>
</span>
<a class="J_DelOrder J_MakePoint" href="javascript:void(0)">删除</a>
<a class=" J_MakePoint" href="#">备忘</a>
<div class="J_ShareSNS sns-share">
<a 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>
{* lee add 结束 *}
样式文件直接用的淘宝的
附件中也附带了这个css
附件下载
for_order
![](http://laolee.org/uploads/2013/06/%E6%88%91%E7%9A%84%E8%AE%A2%E5%8D%95%E6%94%B9%E8%BF%9B%E5%90%8E.jpg)
原来的样子
![](http://laolee.org/uploads/2013/06/%E6%88%91%E7%9A%84%E8%AE%A2%E5%8D%95%E6%94%B9%E8%BF%9B%E5%89%8D.jpg)
找到
view plaincopy
to clipboardprint?
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
增加如下内容
view plaincopy
to clipboardprint?
//把订单的详细内容查询出来
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
找到
view plaincopy
to clipboardprint?
<h6>{$lang.label_order}</h6>
把原来的显示订单的那块删除 改为如下内容
view plaincopy
to clipboardprint?
{* lee add 2013-6-28 开始 *}
<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css">
<style type="text/css">
.mod1 span {
display:inline;
width: auto;
height: auto;
position: static;
overflow: visible;
}
.pagebar {
padding: 0 10px 0 0;
text-align: right;
}
</style>
<div class="main-wrap">
<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css" media="all">
<table class="bought-table" id="J_BoughtTable" data-spm="9">
<colgroup>
<col class="selector">
<col class="baobei">
<col class="price">
<col class="quantity">
<col class="after-service">
<col class="amount">
<col class="trade-status">
<col class="operate">
<col class="other">
</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 colspan="9" style="padding-left:5px;">
<span class="no">
<label>
<a href="user.php?act=order_detail&order_id={$item.order_id}" title="">订单编号:<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 hidefocus="true" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}" class="pic s50"><img alt="查看宝贝详情" src="{$goods_info.goods_thumb}"></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 href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">申请售后</a>
<a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">投诉卖家</a>
</td>
<!--{if $smarty.foreach.foo.iteration == 1}-->
<td class="amount" rowspan="{$item.goods_number}">
<strong>{$item.total_fee}</strong>
<p class="post-type"><!-- (含免运费:0.00 ) -->
<!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png"/>-->
</p></td>
<td class="trade-status" rowspan="{$item.goods_number}">
<a href="#" class="J_MakePoint status success">{$item.order_status}</a>
<span>
<span class="uinfo-icon"></span>
<a href="user.php?act=order_detail&order_id={$item.order_id}" class="detail-link J_MakePoint">订单详情</a>
</span>
<!--<a href="#" class="view-logistics J_MakePoint"">查看物流</a>-->
</td>
<td class="operate" rowspan="{$item.goods_number}" colspan="2">
<!--
<span class="skin-white">
<a href="#" class="small-btn J_MakePoint button">评价</a>
</span>
<a class="J_DelOrder J_MakePoint" href="javascript:void(0)">删除</a>
<a class=" J_MakePoint" href="#">备忘</a>
<div class="J_ShareSNS sns-share">
<a 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>
{* lee add 结束 *}
样式文件直接用的淘宝的
附件中也附带了这个css
附件下载
for_order
相关文章推荐
- ECSHOP二次开发,在用户中心的订单详情页显示商品缩略图
- ECSHOP二次开发,在用户中心的订单详情页显示商品缩略图
- ECSHOP二次开发,在用户中心的订单详情页显示商品缩略图
- ecshop功能二次开发之后台管理增加成本价和毛利
- ecshop二次开发 之在商品分类页如何增加评论等级和评论数量
- ecshop二次开发笔记--订单表结构ecs_order_info说明
- ECSHOP二次开发之给商品增加新字段
- ecshop二次开发——后台增加拣货状态
- ecshop 二次开发之-----增加帮助页面
- ecshop 二次开发 订单模块流程分析和修改,修改确认后未付款可以取消订单
- ECSHOP二次开发之给商品增加新字段
- ECSHOP二次开发--给商品增加一个新字段 另法
- ECSHOP二次开发之给商品增加新字段
- ECSHOP二次开发--给商品增加一个新字段
- ECSHOP二次开发之给商品增加新字段
- ECSHOP商品订单自动确认二次开发教程
- ecshop仿京东商城二次开发
- ecshop二次开发秒杀、限时折扣、清仓等功能
- 关于FlexPaper 2.1.2版本 二次开发 Logo 、打印、搜索、缩略图、添加按钮、js交互、右键菜单等相关问题
- ecshop二次开发 结构分析和代码研究 呵呵