VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: fabioweb on July 05, 2018, 15:21:11 PM

Title: Custom Text for shopper group
Post by: fabioweb on July 05, 2018, 15:21:11 PM
Hello, in my 3.2.14 virtuemart store i need to display some text only for shopper group "rivenditore"
In short i have two main shoppers group: "Cliente" and "Rivenditore"

Once a user is logged in and is "Rivenditore" i need to load some text somewhere into the website
if user is logged in and is "Cliente" the same text will not displayed

Is it possible?

Best regards
Title: Re: Custom Text for shopper group
Post by: GJC Web Design on July 05, 2018, 18:07:00 PM
Get shopper Group

$userModel = VmModel::getModel('user');
$vmuser = $userModel->getCurrentUser();
$vmgroup = $vmuser->shopper_groups;

//$vmgroup is an array
Title: Re: Custom Text for shopper group
Post by: Studio 42 on July 05, 2018, 22:14:03 PM
If you manually set user shopper groups, you can use Joomla user groups restrictions to display a module an affiliate the users in "rivenditore" to this group.
This need one step more, but it's very more flexible after(you can add new menus for eg. Restricted acces to some pages ...)