VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Add Buyers to Joomla Groups for VirtueMart

We are currently unable to provide proper support!

For the last few months we have been very busy working on some huge, very time-consuming and time-sensitive projects, so our support was very limited and we were unable to provide proper support in our forums! We now have a huge backlog of requests from our customers, which we are trying to clear bit by bit. Unfortunately, this takes longer than we anticipated, so our response time is not yet up to par. We are trying our best to improve this situation as soon as possible.

Sorry for the inconvenience and thank you for your understanding!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: User must log out to see effect of group change

User must log out to see effect of group change 19 May 2016 12:24 #1

Hi,
I got the plug-in working and now when an order is placed, the customer is placed in the Joomla! "Customer" group. This should allow the user to view additional menus on the site that are available only to customers. However, the user has to log out and then back in again before these menus appear. It seems to me the session needs to be updated the new group membership information.
I found an article about this issue at www.ostraining.com/support-forum/joomla-...-s-group-membership/
Perhaps the plug-in needs to do something along the lines of:
$session = JFactory::getSession();
$session->set('user', new JUser($currentUser->id)); // Force load from database
It would be nice to avoid making the user log in again to access the restricted areas.
Thanks.

Please Log in or Create an account to join the conversation.

User must log out to see effect of group change 21 May 2016 00:59 #2

Dear John,
Thank you for the suggestion and even the effort to investigate possible solutions.

A while back I already investigated this issue, but I couldn't find a proper solution. The main issue is that order status changes usually don't happen on a page load, where the user's session comes into play, but typically either through the payment gateway sending the payment notification to the server or through the admin manually changing the order status. The Payment gateway's IPN (instant payment notification) message is usually a normal http-call from the payment server to VirtueMart. However, the payment gateway is technically completely different from the user, so when the payment gateway indicates a successfull payment and VM changes the order status to Confirmed, the user's session is NOT available (it would be the payment gateway's session, but that one is not logged in for apparent reasons). So, modifying the user's session is not possible at that point.

The only other way I can see to have the user's group changes have an immediate effect on the current session is to force loading the user from the database for every page call. Clearly this is overkill and a performance killer (somehow defeats the purpose of caches and session storage).

So, for now I don't really know of any proper technical solution to have group changes effect the user's session immediately.

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

  • Page:
  • 1