Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Modules not displaying/hiding properly
Modules not displaying/hiding properly
Modules not displaying/hiding properly
User registers like normal. They can then later subscribe to a plan via Community Builder paid subscriptions. At the point they register, they belong to the Registered group. Once they purchase a subscription, they change to a different group e.g. Subscriber.
After logging on, if the user is only Registered with no subscription, then one menu module should display.
After logging on, if the user has subscribed, then a different menu module should display and the other one will be hidden.
The metamod logic I'm using is -
-- Registered only
if (
$user->usertype == "Registered"
)
return 161;
-- Subscribed (and registered)
if (
( $user->usertype == "Subscriber" )
) return 152;
The CB paid subscription plan changes the group from Registered to Subscribed upon payment of the sub.
Easy so far right.
Well, this metamod logic seems to work fine except, to get the right menu to show up, the user would have to log out and log back in again. CTRL-F5 doesn't help.
Why is that? Can anyone help with this? Or point me in the right direction?
Many thanks.
Re: Modules not displaying/hiding properly
Just tried changing templates and toggling caching, thinking that might be the issue and the issue remains. The user still has to log out for the changes in subscription status to be reflected in the menus.
Has anyone got any ideas on this one?
Re: Modules not displaying/hiding properly
Ugh, this is difficult. Obviously Joomla is only loading up the $user variable when the user first logs in, and changes to the usertype are not showing up.
Can you tell me if the groups that CB is using are standard Joomla groups? Or its own implementation of groups?
Another thing that *might* help is to use the JomGenius group detection. Try this to get it to print out all the groups that the current user is in, and see if it updates any better: (it may not, but it's worth a try)
print_r($core_genius->info("groups"));
If that *does* do the right thing, then you could use this syntax to check for groups:
if ($core_genius->check("groups = Registered")) return 161;
if ($core_genius->check("groups = Subscriber")) return 152;
Hope that might work,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Modules not displaying/hiding properly
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7633
- Newest User:
- mingle7855
- Members Online:
- 0
- Guests Online:
- 135
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked