ECSHOP Member Center 2 modification methods (level price.vip)
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
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>
{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
$update_data = array_merge($update_data, $other);
Add a line of code below
$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".
Related article
-
ecshop implements different price discounts for different payment methods
This article mainly introduces the method of ecshop for different payment methods corresponding to different price discounts, involving the modification operation of the relevant logic decision code at the bottom of Ecshop, which can be referred to by friends in need2016-10-10 -
Usage example of Alipay automatic delivery interface
This article mainly introduces the usage of ecshop Alipay automatic delivery interface, combined with examples to analyze the code modification and interface operation code function and modification skills of Ecshop to achieve Alipay automatic delivery function, which can be referred to by friends in need2016-10-10 -
Ecshop Alipay front desk payment and the background does not show the payment solution
This article mainly introduces the solution that the front desk of Ecshop payment and the background does not show the payment, which involves the modification of the decision logic of the file, and the friends who need it can refer to it2016-09-26 -
Ecshop payment method shows sequential modification method
This article mainly introduces the Ecshop payment method display order modification method, can freely adjust the payment method display order, involving Ecshop simple source code modification, need friends can refer to the next2016-09-26 -
Ecshop implements the method of transmitting the order number and the name of the item when paying
This article mainly introduces the method of Ecshop to transfer the order number and the name of the goods when the payment is made, involving the Ecshop template operation and the modification of the underlying code, and the friends who need it can refer to it2016-09-26 -
This article mainly introduces the solution that Ecshop prompts "This payment method does not exist or the parameter is wrong" after using Alipay to pay successfully, analyzes the reasons for the error prompt and related solutions, and the friends in need can refer to it2016-09-26
-
Ecshop implementation of Alipay mobile web payment function free version example
This article mainly introduces the free version of Alipay mobile web payment function achieved by Ecshop, and analyzes the complete implementation skills of the free version of Alipay mobile terminal under the Ecshop environment in combination with complete examples2016-09-26 -
Change the Email in the ECSHOP comment form to a non-required change
This article mainly introduces how to modify the Email in the ECSHOP comment form as a non-mandatory modification method, and the friends who need it can refer to it2015-09-29 -
Call the number of reviews method on the item list in ECSHOP
This article mainly introduces the method of calling the number of comments in the list of goods in ECSHOP, and the friends who need it can refer to it2015-09-29 -
How to add the mobile phone number query function to the ECSHOP background member list
This article mainly introduces the method of adding the mobile phone number query function in the ECSHOP background member list, and the friends who need it can refer to it2015-09-29
Latest comments