VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on November 11, 2022, 15:25:36 PM

Title: Hot to get shoppergroup info? (administration->Order page)
Post by: EvanGR on November 11, 2022, 15:25:36 PM
Hello,

I need to get (at least) the shoppergroup id(s) for the user, in the Order page.
If I could get the complete shoppergroup data (name etc), would be even better!
Any help appreciated!

Thanks
Title: Re: Hot to get shoppergroup info? (administration->Order page)
Post by: pinochico on November 11, 2022, 15:44:15 PM
you know user_id, then call model for shoppergroups and put inside user_id.
Or?
Title: Re: Hot to get shoppergroup info? (administration->Order page)
Post by: EvanGR on November 11, 2022, 16:23:09 PM
Yes, user id is known. I am looking at the shoppergroup model, what is the method to get a user's assigned shopper groups by user id?
Thanks!
Title: Re: Hot to get shoppergroup info? (administration->Order page)
Post by: GJC Web Design on November 12, 2022, 11:16:30 AM
getShoppergroupById($id, $default_group = false)
Title: Re: Hot to get shoppergroup info? (administration->Order page)
Post by: EvanGR on November 15, 2022, 12:25:38 PM
This method expects the user id, not the shopper group id? Correct?
Title: Re: Hot to get shoppergroup info? (administration->Order page)
Post by: pinochico on November 16, 2022, 21:54:18 PM
I think expect user_id and return shoppergroup_id.

You try call and debug in your view?