Jump to content

Access to user group (in .tpl) to show VIP price?


ayin

Recommended Posts

Hello,

 

I wonder if you guys any simple way to know the customer group of the customer in while processing the .tpl?

 

E.g.

{if $customer->VIP(true)}
  <p>PRICE!</p>
{/if}

Else i would need need to crave within .php code and return a processed price within the Product class as explain in this post: https://www.prestashop.com/forums/topic/174802-product-prices-per-group/

- which i think it is not architecturally correct.

 

Thanks  for your feedback,

Cheers

Link to comment
Share on other sites

You should look for module: customergroups. Im using this module and check php file

 

foreach ($groups as $group) {
if ($group['id_group'] == 4 or 5 6 7 89 etc... ) {
$smarty->assign('VIP', 1);
}
}                
                $smarty->assign('customerGroups', $groups);

 

and after this in .tpl use: {if $vip} PRICE {/if}

  • Like 1
Link to comment
Share on other sites

Hello,

 

I did not quite understand. You mean "prestashop\htdocs\classes\Customer.php"? Which method?

 

 

You should look for module: customergroups. Im using this module and check php file

 

foreach ($groups as $group) {
if ($group['id_group'] == 4 or 5 6 7 89 etc... ) {
$smarty->assign('VIP', 1);
}
}                
                $smarty->assign('customerGroups', $groups);

 

and after this in .tpl use: {if $vip} PRICE {/if}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...