[Resolved] Auto change user roll based on values of of some Custom Post type.
This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a setup with custom post type that resembles a membership type setup.
The process and requirements:
A new user registers as a user with a user form that set the default role as "peg editor - pre-approval."
Once the user has registered on the WordPress platform, he is then rerouted to the "Add new editor" cred form. where he then completes a multi-step form, whet 4 steps there are two fields of interest.
section 1
The first field is a radio field with three options:
Individual memberships
Couple memberships
Student memberships
section 2
The second field directory entry that comes to play is also radio button field
The has only two options yes or no.
section 3
the third field is a status field.
with three options
Pre-Approval
Approved
Declined
Ok so now the challenge :
Once the user has been created his/her role is "per editor - preapproval"
Depending on the options above the editor must make a payment depending on his options.
We are now looking at creating some more rolls.
the rolls that will be is:
Now at this stage, the following must happen.
New member registers and does prelim profile.
In the prelim profile, they will make a selection of the above fields.
In section one they will select the level of membership they want.
In section one when they pick students they will be made role: Peg students.
Students can not be listed on the find an editor directory. that is why the directory entry is hidden from the student form.
then there is the option of individual or couple membership. They will have the option of selecting if they want to be listed or not in the directory. They will have the Peg editor role allocated to them.
Finally, you will have the option of being a PEG Editor executive when you select the single or couple membership and you select the directory entry as yes.
When the admin approves the application they allocate a PEG registration number that is unique. So now the admin opens the approval form, click on the correct candidate that they need to update, and a final screen shows up with the candidate's profile. If approved admin must a the add"PEG membership" number and change the profile status from pre-approved to approved. At this stage when the form update it must change the user role to either Peg-student, peg editor and PEG Editor executive depending on the status of the three variable selections made above.
Is this possible and if so how would I go about doing this.
There will be obvious way to change the role either using Toolset hook or WordPress native hook but you will have to identify where at what action you will be able to utilize what hook.
We need to divide this whole big concept in small parts and accordingly identify the resolution.
You said:
Once the user has been created his/her role is "per editor - preapproval"
Depending on the options above the editor must make a payment depending on his options.
So - how exactly you are taking payments using only WooCommerce?
Sorry for the confusion. The payment is a manual process. The editor registers to become a user, (user forms) then he completes a preliminary profile with this link hidden link
The final form on that page includes the 3 fields identified in the first post on this ticket. That will determine the fees payable. After the above form updates the editor will be rerouted to a form created with formidable where they will be advised of the amount payable. They will then make either an eft or direct payment in the client's bank and forward proof of payment to our client. The client will then open a screen where they will approve the profile and notify the editor that they can then proceed with completing the profile. It is at this stage that the editor's role must then change.
The client opted not to go for an online payment system