Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Add Buyers to Joomla Groups for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • John M
  • John M's Avatar Topic Author
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.

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
  • Page:
  • 1