Hello everybody,
I'm using VM 2.6.17 on Joomla 2.5.27. I'd like to show an article (I mean a Joomla article, a page) only to customers belonging to a specific shopper group. This article could be linked on a menu item or inside a module only visible to that specific shopper group. Anyway, I don't know how to hide/show it based on a shopper group, that is a VM object, not a Joomla one.
Can you help me? Thank you
build your own module ( copy/rename the custom module ) and in the template surround the display by
import VM
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
//detect shopper group
$userModel = VmModel::getModel('user');
$vmuser = $userModel->getCurrentUser();
$vmgroup = $vmuser->shopper_groups;
//is an array - then use in_array() to show or not show
this is VM3 code .. lost interest in VM2.6 as you should... ;)
See http://forum.virtuemart.net/index.php?topic=118683.0
@GJC: your code fits also for VM 2.6, thank you!
I'd like to switch everything to latest version, but I have to convince my customer.
QuoteI'd like to switch everything to latest version, but I have to convince my customer.
when he gets hacked the first person he will blame will be u.. :(