Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / Reward Point Full Suite. How to display the "Group Name" for the customers logged in?

Reward Point Full Suite. How to display the "Group Name" for the customers logged in?

Started by ahhs9162 on 14 Mar 2013, 10:02 PM · Views: 1,180

Results 1 to 4 of 4
14 Mar 2013, 10:02 PM
#1
ahhs9162 avatar

ahhs9162

New Zenner

Join Date:
Aug 2012
Location:
North Carolina
Posts:
28
Plugin Contributions:
0

Post #1 by ahhs9162

Hi,

Is there a code to show the Reward point full suite Group name to the customers?

For example, on the reward point side box, the group name will be shown to the customers.
If I assign the group name "Beautiful Customer" to one customers, then the customer can see his group name(level)

I tried some tricks but no works...

The group name is only showing on the Admin pages... not for the customers.

I'm trying to build the customer membership levels, so I need to display the each group name to my each customer...

Any suggestions will be appreciated.. Thanks.

Wholesale Jewelry Store

http://pnytrading.net/

15 Mar 2013, 5:01 PM
#2
ahhs9162 avatar

ahhs9162

New Zenner

Join Date:
Aug 2012
Location:
North Carolina
Posts:
28
Plugin Contributions:
0

Post #2 by ahhs9162

any suggestions? thanks...

Wholesale Jewelry Store

http://pnytrading.net/

18 Mar 2013, 1:29 PM
#3
ahhs9162 avatar

ahhs9162

New Zenner

Join Date:
Aug 2012
Location:
North Carolina
Posts:
28
Plugin Contributions:
0

Post #3 by ahhs9162

still no suggestions? please help.... thanks

Wholesale Jewelry Store

http://pnytrading.net/

22 Mar 2013, 2:21 PM
#4
ahhs9162 avatar

ahhs9162

New Zenner

Join Date:
Aug 2012
Location:
North Carolina
Posts:
28
Plugin Contributions:
0

Post #4 by ahhs9162

SOLVED!

First, on

/www/includes/functions/extra_functions/reward_points_functions.php

I added a new function ,after the function GetRedeemRatio() :

function GetRedeemGroup($customers_id)
{
	global $db;
	
	$sql = "SELECT gp.group_name
	        FROM ".TABLE_GROUP_PRICING." gp
			LEFT JOIN (".TABLE_CUSTOMERS." as c)
			ON (gp.group_id=c.customers_group_pricing)
			WHERE c.customers_id='".(int)$customers_id."'
			ORDER BY gp.group_id
			"; 

	$result=$db->Execute($sql);

    if($result)
	 return $result->fields['group_name'];
	else
	 return 0;
}

and

on

/www/includes/templates/YOUR_TEMPLATE/sideboxes/tpl_reward_points.php

after $reward_points=GetRewardPoints($_SESSION['cart']->get_products()); (LINE AROUND 11)

add this :

$group_name=GetRedeemGroup($_SESSION['customer_id']);

and one a line about 25, afther the if($reward_points>0) statement

change the line

$content='<div class="cartBoxRewardPoints">'. .....
```       to :

```php
$content.='<div class="cartBoxRewardPoints">'. '<p style="color:green;text-align:center;font-size:12px;font-weight:bold;">My Level : ' . $group_name . '</p><br />' . $customers->fields['group_name'].(int)$reward_points.' '.REWARD_POINTS_IN_CART_TAG.'</div>';

This will make you able to show the customer's group name on the sidebox.

I was trying to build the customer's membership policy,

and now I finally can.

Thank you for this great module... that I can provide betther service to my customer.

Wholesale Jewelry Store

http://pnytrading.net/