ECSHOP Member Center 2 modification methods (level price.vip)

Published: 2015-09-29 11:24:47 Author: Anonymous I would like to comment
Membership has a profound impact on our website, and having a group of sticky users is the key to success. Then how can we attract members to register and convert them into senior members? For example, we can make all members become VIP members, and show relatively favorable prices for VIP members, while there is no discount for users who purchase anonymously

Membership has a profound impact on our website, and having a group of sticky users is the key to success. So how can we attract members to register and then convert them into senior members? For example, we can make all members become VIP members, and show relatively favorable prices for VIP members, while there is no discount for users who purchase anonymously.

Displays membership level prices

In ecshop, members have levels, so we can set different discounts according to the level of members, and display different preferential prices.

Modify the goods_list() section of admin/includes/lib_goods.php

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

Add the following code in front

Copy code
The code is as follows:

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']));
}
}


Modify the template file admin/templates/goods_list.htm to add the following code between {$goods.shop_price} and </span>


Copy code
The code is as follows:

{if $goods.user_price}
{foreach from=$goods.user_price item=user_price }

{$user_price.rank_name} : {$user_price.price}
{/foreach}
{/if}


Member registration is successful VIP

According to the default procedure of ECSHOP, the newly registered members are "non-special level", you want to achieve the effect you expect, you have to change the registration procedure, registration success at the same time automatically set to a "special level", for example, let the member become a "vip user" after successful registration, you can use the following method to modify.

Modify includes/lib_passwort.php in


Copy code
The code is as follows:

$update_data = array_merge($update_data, $other);


Add a line of code below


Copy code
The code is as follows:

$update_data['user_rank']=2; // Automatically register as "VIP Member"
$GLOBALS['db']->query("update ".$GLOBALS['ecs']->table('user_rank') . " set special_rank =1 where rank_id=2" );


After this modification, a member registration is a "vip user".

  • Tag: Member Center ECShop

Related article

Latest comments