ecshop会员中心我的收藏的商品图片和时间的教程

ECSHOP教程 来源: ECSHOP教程网www.ecshop119.com 时间:2020-12-18 ECSHOP教程分类:ECSHOP用户中心修改

ECSHOP教程网讲解下ecshop会员中心我的收藏显示收藏的商品图片和时间的教程方法

function get_collection_goods($user_id, $num = 10, $start = 0)
{
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_thumb, g.market_price, g.shop_price AS org_price, '.
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
'g.promote_price, g.promote_start_date,g.promote_end_date, c.rec_id, c.is_attention' .
' FROM ' . $GLOBALS['ecs']->table('collect_goods') . ' AS c' .
" LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ".
"ON g.goods_id = c.goods_id ".
" LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ".
" WHERE c.user_id = '$user_id' ORDER BY c.rec_id DESC";
$res = $GLOBALS['db'] -> selectLimit($sql, $num, $start);
$goods_list = array();
while ($row = $GLOBALS['db']->fetchRow($res))
{
if ($row['promote_price'] > 0)
{
$promote_price = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']);
}
else
{
$promote_price = 0;
}
$goods_list[$row['goods_id']]['rec_id'] = $row['rec_id'];
$goods_list[$row['goods_id']]['formated_add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']);
$goods_list[$row['goods_id']]['is_attention'] = $row['is_attention'];
$goods_list[$row['goods_id']]['goods_id'] = $row['goods_id'];
$goods_list[$row['goods_id']]['goods_name'] = $row['goods_name'];
$goods_list[$row['goods_id']]['goods_thumb'] = $row['goods_thumb'];
$goods_list[$row['goods_id']]['market_price'] = price_format($row['market_price']);
$goods_list[$row['goods_id']]['shop_price'] = price_format($row['shop_price']);
$goods_list[$row['goods_id']]['promote_price'] = ($promote_price > 0) ? price_format($promote_price) : '';
$goods_list[$row['goods_id']]['url'] = build_uri('goods', array('gid'=>$row['goods_id']), $row['goods_name']);
}
return $goods_list;
}
2.然后打开它的模板文件user_clips.dwt
找到这一部分,收藏商品列表页面
样式根据自己的需求改动。

商品图片:<img src="{$goods.goods_thumb}" /> 

收藏时间:{$goods.formated_add_time}


这样就大功告成,去测试下效果吧


本文模板屋原创地址: https://www.ecshop119.com/ecshopjc-1074.html
模板屋版权所有 © 转载时必须以链接形式注明出处!

ECSHOP模板屋
ecshop开发团队 ecshop开发中心 ecshop模板制作 ecshop模板屋
ECSHOP
ecshop下载 ecshop安装教程 ecshop在线演示 ecshop后台测试
ECSHOP二次开发手册
ecshop教程 ecshop二次开发 ecshop模板教程 ecshop微信配置
ECSHOP商城网站建设
ecshop空间域名 ecshop商城建设 ecshop模板修改 ecshop开发定制
服务支持:7X24小时 151 059 55077
ECShop二次开发
ecshop搭建
qqtelcodeback_top
温馨提示

确定取消
温馨提示

关闭