[Skip to main content](#vessel-content)

#   Remove user from group

##

- **[dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")**
- [![dbarnhart863's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile") Topic Author
- [ Offline](/forum/user/22676-dbarnhart863)

Less More

- Posts: 54
- Thank you received: 3
-
-

11 years 8 months ago [\#194133](#194133) by [dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")  *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#194133 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")* was created by *[dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4

Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.

Please advise on how to remove a user from a group after purchase. Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#194150](#194150) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#194150 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Hi,

I think the best will be to duplicate the plugin "group after purchase" in order to create a "remove group after purchase".
And instead of adding a user group to the user, you will remove it.

After that, you might use the Mass Action for the order confirmation and use the action "change the user group".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")**
- [![dbarnhart863's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile") Topic Author
- [ Offline](/forum/user/22676-dbarnhart863)

Less More

- Posts: 54
- Thank you received: 3
-
-

11 years 8 months ago [\#194369](#194369) by [dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")  Replied by *[dbarnhart863](/forum/user/22676-dbarnhart863 "View dbarnhart863's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#194369 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Thanks for the reply. However, I am not a developer so your suggestion isn't something I can do.

Is there a line of code that I could add to the plugin "group after purchase" that would remove a user from a particular group? I still need that plugin to add users to groups as well.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

11 years 8 months ago [\#194376](#194376) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#194376 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Hi,

Unfortunately, I don't see any easy code change which would allow for that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joomleb](/forum/user/2322-joomleb "View joomleb's Profile")**
- [![joomleb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2322-joomleb "View joomleb's Profile")
- [ Offline](/forum/user/2322-joomleb)

Less More

- Posts: 461
- Thank you received: 36
-
-

4 years 3 weeks ago [\#346188](#346188) by [joomleb](/forum/user/2322-joomleb "View joomleb's Profile")  Replied by *[joomleb](/forum/user/2322-joomleb "View joomleb's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#346188 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Hi guys,

> Jerome wrote: ...I think the best will be to duplicate the plugin "group after purchase" in order to create a "remove group after purchase". And instead of adding a user group to the user, you will remove it

**1** - I suppose you mean the "**Hikashop Group Plugin**" that enables to change (to add) the group of a user after purchasing a product: "Product &gt; Custom Fields &gt; User group after purchase: ..."
- Please, Is this still the "instant without delay" solution ?
- Please, Do you have any hack code suggestion ?
- Would not be useful to add the "remove group" option to the default plugin ?

It might be useful with HikaSubscription when we need to switch from Subscription B Plan (Registered B User Group) to Subscription C Plan (adding the user to the Registered C User Group and he needs to be removed from the Registered B User Group) by using the HikaShop "Product &gt; Subscriptions &gt; Relation type: Upgrade" feature

**2** - Considering that the "Hikashop Group Plugin &gt; Force user logout on group update: Yes" has effect when the Joomla setting "Session Handler: Database".
Please, What do you think about "the best Session handler" for HikaShop features ?
Is the PHP Filesystem still [ the best solution](https://forum.joomla.org/viewtopic.php?f=706&t=972290) ?
Do you have any experience about memcache ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

4 years 3 weeks ago [\#346193](#346193) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#346193 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Hi,

1.A Yes, it would be instant as the user would be removed from the group drectly when the order of the renewal product would be confirmed.
1.B Supposing you don't need the normal feature of this plugin to add a user to a group after a purchase (because you can also do it with the subscription itself for example), then the modification is quite simple.
You could change the line: Code:

$userGroups[] = $oneProduct-&gt;product_group_after_purchase;

to: Code:

$key = array_search($oneProduct-&gt;product_group_after_purchase, $userGroups); if($key !== false) unset($userGroups[$key]);

1.C I'm not sure it would make sense to add a "remove group after purchase" setting. I don't remember someone else case where this would have been necessary.

1.D Adding it to HikaSubscriptions might make more sense, indeed.

2. Normally, this doesn't matter. Even with the file system, it only matters depending on which payment plugin you're using. For example, with the PayPal normal payment plugin, it would be a problem, but not with the new PayPal Checkout plugin due to the workflow of the communications between the website and the gateway.
Also, logging out the user might not be necessary in your case. You could just let the user logged in and wait his session expires automatically after a while.
But if you need the user to be logged out after a user group change made by this plugin, then you do want to use the database session handler.
I don't have experience on memcache so I wouldn't be able to comment.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joomleb](/forum/user/2322-joomleb "View joomleb's Profile")**
- [![joomleb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2322-joomleb "View joomleb's Profile")
- [ Offline](/forum/user/2322-joomleb)

Less More

- Posts: 461
- Thank you received: 36
-
-

4 years 3 weeks ago -  4 years 3 weeks ago [\#346212](#346212) by [joomleb](/forum/user/2322-joomleb "View joomleb's Profile")  Replied by *[joomleb](/forum/user/2322-joomleb "View joomleb's Profile")* on topic *[Remove user from group](/forum/33-customers/875582-remove-user-from-group#346212 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4  Is there a way to remove a user from a group upon purchase? I know users can be added to a group after purchase, but I also need for some of my users to be removed from a group after they renew their membership.  Please advise on how to remove a user from a group after purchase. Thanks.")*

Hi Nicolas,

**1A** - Thanks

**1B** - You are right and Thanks!

**1C** - Well, looking for answers, during last days I found several related posts about this and, as Jerome wrote, viewing that could be a simple solution, that's why I suggested it here...

**1D** - Being that Jerome is in this discussion, Do I have to open a new HikaSubscription topic ? Or Is it better to wait for him here ? (Maybe he has yet something in his roadmap)

Anyway, they are 2 different features useful for 2 different things:

into **HikaSubscription** &gt; Having the "to add" feature with the "to remove" feature means to have a "to move" feature for the time period of the subscription. (As a temporary access to the content). Once exhaled, the reverse path will be performed: "to add" &gt; "to remove" and "to remove" &gt; "to add"

into **Hikashop Group Plugin** &gt; the "to add" or the "to remove" is permanent, definitive.
In my specific case this makes more sense. Let me say:
- only Registered users user group can buy Subscriptions
- I have 2 Subscriptions levels types: Plan B (adding users to the Registered B user group), Plan C (adding users to the Registered C user group)
- while a user will always belong to the Registered user group, when a user from Plan B switches to Plan C not only must be added to the Registered C user group, but must be removed from the Registered B user group &gt; **forever**
- In fact, because if Plan C expires, the user will not be a subscriber of Plan B, but will simply go back to being just a registered user

Do you agree ?

**2A** - Thanks. So, for the User Group feature I can set "Hikashop Group Plugin &gt; Force user logout on group update: No", Right ?
While for the Payment Plugins, Is it a must ?

**2B** - So, in addition to the normal PayPal payment plugin, Please, What are the HikaShop Payment plugins that need the Joomla setting "Session Handler: Database" ?

Last edit: 4 years 3 weeks ago by [joomleb](/forum/user/2322-joomleb "View joomleb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzU1ODItcmVtb3ZlLXVzZXItZnJvbS1ncm91cD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.060 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
