我的订单增加缩略图 仿淘宝 已买到的宝贝 ecshop二次开发

先上效果图吧

原来的样子

找到

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

增加如下内容

  1. //把订单的详细内容查询出来  
  2. if(is_array($orders) && count($orders) > 0) {  
  3.         $order_ids = '';  
  4.         $new_orders = array();  
  5.         foreach($orders as $val) {  
  6.                 $order_ids .= $val['order_id'].',';  
  7.         }  
  8.         $order_ids = substr($order_ids,0,-1);  
  9.   
  10.         $goods_info = array();  
  11.         $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)";  
  12.         $result = $db->query($sql);  
  13.         while($row = $db->fetch_array($result)) {  
  14.                 $goods_info[$row['order_id']][] = $row;  
  15.         }  
  16.   
  17.         foreach($orders as $key=>$val) {  
  18.                 $val['goods'] = $goods_info[$val['order_id']];  
  19.                 $val['goods_number'] = count($goods_info[$val['order_id']]);  
  20.                 $new_orders[] = $val;  
  21.         }  
  22.         $orders = & $new_orders;  
  23. }  

修改模板user_transaction.dwt
找到

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

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

  1. {* lee add 2013-6-28 开始 *}  
  2. <link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css">  
  3. <style type="text/css">  
  4. .mod1 span {  
  5.         display:inline;  
  6.         width: auto;  
  7.         height: auto;  
  8.         position: static;  
  9.         overflow: visible;  
  10. }  
  11.   
  12. .pagebar {  
  13.         padding: 0 10px 0 0;  
  14.         text-align: right;  
  15. }  
  16. </style>  
  17. <div class="main-wrap">  
  18. <link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css" media="all">  
  19. <table class="bought-table" id="J_BoughtTable" data-spm="9">  
  20. <colgroup>  
  21. <col class="selector">  
  22. <col class="baobei">  
  23. <col class="price">  
  24. <col class="quantity">  
  25. <col class="after-service">  
  26. <col class="amount">  
  27. <col class="trade-status">  
  28. <col class="operate">  
  29. <col class="other">  
  30.         </colgroup>  
  31. <thead>  
  32. <tr class="col-name">  
  33. <th></th>  
  34. <th class="baobei">宝贝</th>  
  35. <th class="price">单价(元)</th>  
  36. <th class="quantity">数量</th>  
  37. <th class="after-service">售后</th>  
  38. <th class="amount">实付款(元)</th>  
  39. <th class="trade-status">  
  40. <div class="trade-status">  
  41.                         交易状态  
  42.                         </div>  
  43. </th>  
  44. <th class="remark">交易操作</th>  
  45. <th class="other">其它操作</th>  
  46. </tr>  
  47. </thead>  
  48.   
  49. <!--{foreach from=$orders item=item}-->  
  50. <tbody class=" xcard">  
  51. <tr class="sep-row">  
  52. <td colspan="9"></td>  
  53. </tr>  
  54. <tr class="order-hd">  
  55. <td colspan="9" style="padding-left:5px;">  
  56.          <span class="no">  
  57.          <label>  
  58.                 <a href="user.php?act=order_detail&order_id={$item.order_id}" title="">订单编号:<span class="order-num">{$item.order_sn}</span></a>  
  59.          </label>  
  60.          </span>  
  61.          <span class="deal-time">成交时间:{$item.order_time}</span>  
  62.          </td>  
  63. </tr>  
  64.   
  65.         <!--{foreach from=$item.goods item=goods_info name=foo}-->  
  66. <tr id="item{$goods_info.goods_id}" class="order-bd <!--{if $item.goods_number > 0 && $smarty.foreach.foo.iteration == $item.goods_number}-->last<!--{/if}-->">  
  67. <td class="baobei" colspan="2">  
  68.                 <a hidefocus="true" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}" class="pic s50"><img alt="查看宝贝详情" src="{$goods_info.goods_thumb}"></a>  
  69. <div class="desc">  
  70.                 <a class="baobei-name" href="/shop/goods.php?id={$goods_info.goods_id}">{$goods_info.goods_name}</a>  
  71.                 <!--  
  72. <div class="spec"><span>颜色分类: **</span><span>参考身高: 均码 0-18月</span></div>  
  73.   
  74. -->  
  75.                 </div>  
  76. </td>  
  77. <td class="price" title="{$goods_info.goods_price}">{$goods_info.goods_price}</td>  
  78. <td class="quantity" title="{$goods_info.goods_number}">{$goods_info.goods_number}</td>  
  79. <td class="after-service">  
  80.                         <a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">申请售后</a>  
  81.                         <a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">投诉卖家</a>  
  82.                 </td>  
  83.   
  84.                 <!--{if $smarty.foreach.foo.iteration == 1}-->  
  85. <td class="amount" rowspan="{$item.goods_number}">  
  86.                         <strong>{$item.total_fee}</strong>  
  87. <p class="post-type"><!-- (含免运费:0.00 ) -->  
  88.   
  89.                         <!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png"/>-->  
  90.                 </p></td>  
  91. <td class="trade-status" rowspan="{$item.goods_number}">  
  92.                         <a href="#" class="J_MakePoint status success">{$item.order_status}</a>  
  93.                         <span>  
  94.                         <span class="uinfo-icon"></span>  
  95.                         <a href="user.php?act=order_detail&order_id={$item.order_id}" class="detail-link J_MakePoint">订单详情</a>  
  96.                         </span>  
  97.                         <!--<a href="#" class="view-logistics J_MakePoint"">查看物流</a>--> 
  98.                 </td> 
  99. <td class="operate" rowspan="{$item.goods_number}" colspan="2"> 
  100.                         <!-- 
  101.                         <span class="skin-white"> 
  102.                                 <a href="#" class="small-btn J_MakePoint button">评价</a> 
  103.                         </span> 
  104.  
  105.                         <a class="J_DelOrder J_MakePoint" href="javascript:void(0)">删除</a> 
  106.                         <a class=" J_MakePoint" href="#">备忘</a> 
  107. <div class="J_ShareSNS sns-share"> 
  108.                                 <a href="#" class="J_MakePoint">分享</a> 
  109.                         </div> 
  110.  
  111.                         --> 
  112.                         {$item.handler} 
  113.                 </td> 
  114.  
  115.                 <!--{/if}--> 
  116.         </tr> 
  117.  
  118.         <!--{/foreach}--> 
  119.    </tbody> 
  120.  
  121. <!--{/foreach}--> 
  122. <tfoot> 
  123. <tr class="sep-row"> 
  124. <td colspan="9"></td> 
  125. </tr> 
  126. <tr class="** skin-gray"> 
  127. <td colspan="3"></td> 
  128. <td class="page-nav-cell" colspan="6"> 
  129.                 <!-- #BeginLibraryItem "/library/pages.lbi" --><!-- #EndLibraryItem -->  
  130.                 </td>  
  131. </tr>  
  132. </tfoot>  
  133. </table></div>  
  134.   
  135.  {* lee add 结束 *}  

样式文件直接用的淘宝的
附件中也附带了这个css
附件下载
for_order

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值