在ECSHOP后台商品列表显示会员等级价格

ECSHOP教程 来源: ECSHOP教程网www.ecshop119.com 时间:2011-11-08 ECSHOP教程分类:ECSHOP后台管理修改

1、修改admin/includes/lib_goods.php的goods_list()函数部分

return array('goods' => $row, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);

 

前面增加下面代码

 

foreach($row as $key_tmp=>$goods_tmp)
{
$sql = "SELECT rank_id, IFNULL(mp.user_price, r.discount * $goods_tmp[shop_price] / 100) AS price, r.rank_name, r.discount " .
'FROM ' . $GLOBALS['ecs']->table('user_rank') . ' AS r ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = '$goods_tmp[goods_id]' AND mp.user_rank = r.rank_id " .
"WHERE r.show_price = 1 OR r.rank_id = '$_SESSION[user_rank]'";
$res_up = $GLOBALS['db']->query($sql);
while ($row_up = $GLOBALS['db']->fetchRow($res_up))
{
$row[$key_tmp]['user_price'][$row_up['rank_id']] = array(
'rank_name' => htmlspecialchars($row_up['rank_name']),
'price' => price_format($row_up['price']));
}
}

 

2、

 

修改

模板文件

admin/templates/goods_list.htm

 

在{$goods.shop_price}与</span>之间增加下面代码

 

{if $goods.user_price}
{foreach from=$goods.user_price item=user_price }
<br>
{$user_price.rank_name}:{$user_price.price}
{/foreach}
{/if}

转载请注明:ECSHOP模板屋-ECshop教程网http://www.ecshop119.com/ecshopjc-469.html

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
温馨提示

确定取消
温馨提示

关闭