- Posts: 13
- Thank you received: 0
Put pending or offline payment users in own group
- Alan Smith
- Topic Author
- Offline
- New Member
-
Less
More
5 years 11 months ago #125206
by Alan Smith
Put pending or offline payment users in own group was created by Alan Smith
Tuan:
I would like to be able to put users with pending status in their own user group OR to do the same with users who checkout with the offline payment option. It seems that running some code in the "Subscription Stored Script " part of the plan would be the logical place. If you point me in. the right direction, I can add the code and try it.
Thanks!
-Alan
I would like to be able to put users with pending status in their own user group OR to do the same with users who checkout with the offline payment option. It seems that running some code in the "Subscription Stored Script " part of the plan would be the logical place. If you point me in. the right direction, I can add the code and try it.
Thanks!
-Alan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
5 years 11 months ago #125208
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Put pending or offline payment users in own group
Hi Alan
Try this code below (replace 100, 101 with IDs of the user groups you want)
Then check to see whether it works
Tuan
Try this code below (replace 100, 101 with IDs of the user groups you want)
Code:
$user = JFactory::getUser($row->user_id);
$currentGroups = $user->get('groups');
$newGroups = [100, 101];
$currentGroups = array_unique(array_merge($currentGroups, $newGroups));
$user->set('groups', $currentGroups);
$user->save(true);
Then check to see whether it works
Tuan
Please Log in or Create an account to join the conversation.
- Alan Smith
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
5 years 11 months ago #125210
by Alan Smith
Replied by Alan Smith on topic Put pending or offline payment users in own group
That works perfectly - THANK YOU!
Best regards,
Alan
Best regards,
Alan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
5 years 11 months ago #125232
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Put pending or offline payment users in own group
Great. I'm glad it helps
Tuan
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.