关于让ecshop用户中心显示用户会员等级
2016-09-11 20:39 来源:www.chinab4c.com 作者:ecshop专家
/includes/lib_clips.php文件中搜索如下代码
$sql = "SELECT pay_points, user_money, credit_line, last_login, is_validated FROM " .$GLOBALS['ecs']->table('users'). " WHERE user_id = '$user_id'";
|
改成
$sql = "SELECT pay_points, user_money, user_rank, credit_line, last_login, is_validated FROM " .$GLOBALS['ecs']->table('users'). " WHERE user_id = '$user_id'";
|
然后在后面继续插入代码
if($row['user_rank']=='0') {
$sql2 = "SELECT b.rank_name as userrank FROM ". $GLOBALS['ecs']->table('users') ." as a,".$GLOBALS['ecs']->table('user_rank')." as b WHERE a.rank_points > b.min_points AND a.rank_points < b.max_points AND a.user_id = '$user_id'";
}else {
$user_rank = $row['user_rank'];
$sql2 = "SELECT b.rank_name as userrank FROM ". $GLOBALS['ecs']->table('users') ." as a,".$GLOBALS['ecs']->table('user_rank')." as b WHERE a.user_rank = b.rank_id AND a.user_id = '$user_id'";
}
$row2 = $GLOBALS['db']->getRow($sql2);
|
再找到下面代码
$info = array();
$info['username'] = $_SESSION['user_name'];
$info['shop_name'] = $GLOBALS['_CFG']['shop_name'];
$info['integral'] = $row['pay_points'] . $GLOBALS['_CFG']['integral_name'];
|
下面插入
if ($row2['userrank'] != null){
$info['userrank'] = $row2['userrank'];}
else {
$info['userrank'] = "普通会员";
}
|
/themes/当前模板/user_clips.dwt写入相应位置加入:
<font class="f1">您的会员级别为:<strong>{$info.userrank}</strong> {$rank_name} {$next_rank_name}</font>
|
更新缓存,刷新用户中心,就能看到效果了,我这边就不贴图了。
最近更新
常用插件
- ecshop2.7.2生成虚拟订单2.
以前我们开发过ecshop下的虚拟订单,就是客户在访问的时候,会自动生...
- ecshop二次开发商品购买增
图片1香...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
- ecshop最小购买数量控制插
ecshop最小购买数量控制插件,这个插件主要是为我们提供一个十分方便...
- ecshop2.7.1邮件发送插件
ecshop2.7.1邮件发送插件:该插件主要的开发思想是源于ecshop短信发送系统...
ecshop热门问答
ecshop热门资料
ecshop图片框
ecshopdoesn
ecshopscript
订单来源
ecshoppaypal支付
ecshop电子地图
ecshop百度大
ecshop中铁快运
ecshopstate
ecshop信息同步
ecshop多价格购物车
ecshopconversion
ecshop商家
ecshop的正體中文模版
ecshop复杂重写
ecshop赐教
ecshop压缩
ecshop分类页产品数量
ecshop图片导航
ecshop表语
ecshop商品页
ecshop主广告
ecshop消费卡
模板问题
ecshop百度输入
ecshop细化
ecshopsearch
ecshop恶意
ecshop看不见
ecshop中心点