XF 2.2 Delete group when a user buys an upgrade?

Myck

Member
Hello, I need help please, I tried to do it but it was not possible, I also searched the entire forum and I did not find something similar to my case.

It is about group promotions, then I will comment on the context.

I have the following User Groups:

Free
Basic
Premium


I am using an addon that automatically adds to the "Free" group when a user registers.

I have 2 paid User Upgrades available :

Basic
Premium


When a user purchases a Basic upgrade they are added to the "Basic" user group, then the user is now part of two groups, "Free" and "Basic".

My question is how do I remove the user from the "Free" group when he buys the Basic upgrade? I have tried with the promotion of users but I cannot understand it, I would greatly appreciate if you could guide me.
 
Use the is not a member of user group criteria for the free user group promotion, and select the basic and premium user groups.

If it doesn't work, contact the add-on developer for help.

You don't need an add-on to promote members to an additional group on registration
 
Use the is not a member of user group criteria for the free user group promotion, and select the basic and premium user groups.

If it doesn't work, contact the add-on developer for help.

You don't need an add-on to promote members to an additional group on registration
I have achieved it, I created the following promotion to fulfill my two objectives.

1679021204086.png

1. Now when the user registers he is automatically assigned to the "Free" group.

2. Now if the user buys an upgrade to the "Basic" group the "Free" group is removed, but I had to run CRON manually to make it immediate.

But I find a drawback, when a user buys a Basic or Premium upgrade he expects to enjoy the group benefits immediately, but the user is still in the "Free" group before the group promotion CRON is executed.

For me it is inconvenient because the permissions that I have configured for the "Basic" and "Premium" group do not work if it is still in the "Free" group.

How can I make it so that the "Free" group is removed immediately when I buy the upgrades?

How often does the group promotion CRON run?
 
It worked for me, thank you very much.

Would this considerably affect the performance of my forum by running every minute?
Probably not... but why not just run it every 10-15 minutes and have an alert/notice to the users that the upgrades are not instant and are processed on a 10/15 minute cycle?
 
Back
Top Bottom