今天給大家介紹一篇文章,叫做在Ecshop用戶中心的收藏列表里顯示商品縮略圖,分享給大家供大家參考。具體如下:
1)、
修改 includes/lib_clips.php 文件
將下面代碼
$sql = 'SELECT g.goods_id, g.goods_name, g.market_price, g.shop_price AS org_price, '.
修改為
$sql = 'SELECT g.goods_id, g.goods_name,g.goods_thumb, g.market_price, g.shop_price AS org_price, '.
然后找到 下面代碼
$goods_list[$row['goods_id']]['rec_id'] = $row['rec_id'];
在它下面增加一行
$goods_list[$row['goods_id']]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
2)、
然后修改模板文件,這里以 官方默認模板為例進行講解。
打開 /themes/default/user_clips.dwt 文件
找到
<th width="35%" bgcolor="#ffffff">{$lang.goods_name}</th>
在它上邊增加
<th bgcolor="#ffffff">縮略圖</th>
繼續找到
<td bgcolor="#ffffff"><a href="{$goods.url}" class="f6">{$goods.goods_name|escape:html}</a></td>
在它上邊增加
<td bgcolor="#ffffff"><a href="{$goods.url}" ><img src="{$goods.goods_thumb}" width="100" height="100"></a></td>
3)、大功告成
希望本文所述對大家的程序有所幫助
新聞熱點
疑難解答