Issue with User Joomla group change mass action

  • Posts: 8
  • Thank you received: 1
2 years 4 months ago #338190

-- url of the page with the problem -- : socouture-rouen.fr/
-- HikaShop version -- : 4.4.5
-- Joomla version -- : 4.0.5
-- PHP version -- : 8.0.13

Hi,
I've setup a mass action to replace a user group (tried also with just adding, same issue occurs...) when a client purchases a certain product. I want them to be a member of a new group, that is not under 'registered' group, and to remove them from the 'registered' group'
I want to make some of the site content available only to a user having purchased this type of product.

However, when I enable this mass action trigger, the user does the purchase and when the checkout process is completed, the user is automatically logged out of their session.
When they log back in, the order has gone thru but their cart still shows the product.

I've checked the pages and menu items that are accessed after checkout and have adjusted the access levels (i may have missed something but i have checked 2/3 times...) to make sure that their new group has access (and so being removed from 'registered' shouldn't cause a loss of access rights).

When i disable the trigger, the order & checkout process goes thru to the end and the user is not logged out.
Any ideas ?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 3 months ago #338207

Hi,

Yes, the mass action system will logout the users when it changes their user groups.
That's because Joomla caches the user groups data of the current user in its user session.
And thus if a mass action changes the user groups without logging out the corresponding users, they wouldn't see any change until they logout and login again.
So we force the logout as the mass action system cannot clear the user session caching data as it can be done from other user sessions where that information is not accessible to it.

Now regarding the cart, you have a setting "clean cart when order is" in the HikaShop configuration.
If that setting is set to "created", then the cart data will be cleared when the order is created, before the user is redirected to the payment gateway for the payment.
If that setting is set to "confirmed", then the cart data will be cleared when the customer comes back from the payment gateway, just before displaying the thank you page.
If you set that setting to "confirmed" and you have a mass action forcefully logging out the user when the order is confirmed (so after the payment, but before the user is redirected back to the website), the user will indeed be redirected to the login form, and the cart won't be cleared.
In that case, I would recommend changing that setting to "created" so that the cart is cleared before the redirection to the payment gateway.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum