News:

Looking for documentation? Take a look on our wiki

Main Menu

Displaying usergroup name

Started by Agaton, October 03, 2019, 18:53:50 PM

Previous topic - Next topic

Agaton

Hi,

I am currently displaying quantity dependant pricing for various logged in user groups. I know how to display user name using $user->name. I am also able to obtain user group id for both vm and joomla.

How do I display usergroup/shopper group name without writing the query direct to the template override? Is this possible?

Thanks

Milbo

When you know the id it is quite simple



shoppergroup = VmModel::getModel('shoppergroup')->getShopperGroup(YourId)->shopper_group_name



It makes sense to store the model in a temp var.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Agaton

Thanks, that's the missing bit...

Agaton

Quote from: Milbo on October 08, 2019, 21:14:17 PM
When you know the id it is quite simple



shoppergroup = VmModel::getModel('shoppergroup')->getShopperGroup(YourId)->shopper_group_name



It makes sense to store the model in a temp var.

That worked perfectly thank you.... One more thing

What would I use to display the users company name in product details override... $user->name is obviously the users name, but what would I use for the company.