VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: newsomjk on June 20, 2013, 23:06:25 PM

Title: How to get the shopper group of a user?
Post by: newsomjk on June 20, 2013, 23:06:25 PM
I can't figure out how to access the shopper group of a user. I tried print_r($user) and it has no reference to shopper group.

I've searched google for hours and the forum for hours, and the documentation, but none of it seems to answer this. At least as far as I found.

Any help would be much appreciated.
Title: Re: How to get the shopper group of a user?
Post by: jenkinhill on June 21, 2013, 11:06:03 AM
The Shopper Group is displayed in domain/administrator/index.php?option=com_virtuemart&view=user
Title: Re: How to get the shopper group of a user?
Post by: newsomjk on June 25, 2013, 20:57:47 PM
I meant in code, we have certain functions we want to run when a user of a specific shopper group buys specific items etc.
In virtuemart 1.5 we used
$_SESSION['auth']['shopper_group_id']

A print out of $_SESSION now shows this blurb " [_authGroups:protected] => Array (
Title: Re: How to get the shopper group of a user?
Post by: K&K media production on June 25, 2013, 21:55:15 PM
http://forum.virtuemart.net/index.php?topic=101901.msg339146#msg339146
Title: Re: How to get the shopper group of a user?
Post by: newsomjk on June 26, 2013, 00:35:28 AM
Of course I would search shopper group with a space and not find it...

In that case something went wrong with my migration because I started working on some sql of my own but only the admin shows up in the #__virtuemart_vmuser_shoppergroups

Awesome.