Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Menu for vm shopper with 2 shopper...
Menu for vm shopper with 2 shopper groups attached
Menu for vm shopper with 2 shopper groups attached
Hi,
Using Joomla 2.5.14 - Template real copy of Beez20 , Virtuemart 2.0.26d - MetaMod 3.13b
We have 2 different shopper groups - shopper group 1(id 1) and shopper group 2 (id 2) - with different prices. We have 1 product that we only wants to be available to some of our shoppers from each shopper group so this product is only made availble to shopper group 3 (id 3) and then we have attached shopper group 3 to these shoppers so now some of our shopper have 2 shopper groups attached. This is working fine in VM.
For showing this 1 product to our shoppers we have VM Product Builder from Break Design attached to a menu and it's this menu we want only to show if shopper has attached shopper group 1+3 or 2+3 - but I can't get it to work.
Have created a menu + modul - menu assignment and module position is specified in MetaMod, and I used this php code
$vm = JomGenius("virtuemart"); // need this at the start of every rule
/* for VM shopper group 6, use module XXX */
if ( $vm->check( "shopper_group = 3" ) ) return 118;
Is it possible ?
Re: Menu for vm shopper with 2 shopper groups attached
If you find a solution for above problem with shopper assigned to more than one shopper groups I would appreciate to hear from you but I managed to solve my problem at the moment with
if ($user->id == xxx) return 118;
added for every user that we wants to show this menu to.
Re: Menu for vm shopper with 2 shopper groups attached
Hi stensbo,
just following up on this old post:
The code in JomGenius only detects 1 shopper group per person, as you have found out. However, if more than 1 is stored in the database for a given user, you can detect them this way:
$query = "SEL" . "ECT virtuemart_shoppergroup_id FROM #_" . "_virtuemart_vmuser_shoppergroups " .
" WHERE virtuemart_user_id = '$id' order by virtuemart_shoppergroup_id";
$db->setQuery( $query );
$vals = $db->loadColumn();
if (count($vals) == 2 and $vals[0] == 1 and $vals[1] == 3) return 118;
- Index
- » MetaMod
- » MetaMod General Support
- » Menu for vm shopper with 2 shopper...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5946
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 7675
- Newest User:
- ferelya229
- Members Online:
- 1
- Guests Online:
- 254
- Online:
- ferelya229
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked