I recently had a client with a small annual-fee based member site running on BuddyPress want to add 2 more member tiers, with different annual fees.
- Tier 1: Professionals, to show in public directory
- Tier 2: Affiliates, not to show in public directory
- Tier 3: Students, not to show in public directory
The site’s existing system:
- Gravity Forms User Registration Add-On
- Gravity Forms PayPal Add-On
To work within the existing system, I found the ability to assign different member types in BuddyPress was not difficult. You can add these on the fly pretty easily to your functions.php or your bp-custom.php files or you can add them using a plugin: here’s one by BuddyBoss and a free one by BuddyDev.
I choose the BuddyBoss plugin, for a few reasons:
- So my client’s assistant would be able to add new member types in the future and easily assign xProfile fields based on member type.
- Easy to show/hide from public directory.
- The option of having a tabbed directory for different member types in the future.
- The ability assign WP roles to member types.
The other plugin I’m using tie this together: BuddyPress Xprofile Member Type Field, by BuddyDev here.
The BIG Problem
Once I had all the member types set, if I was using the default BuddyPress registration form, this would have been cake, because each registrant could select his/her member type. So, I mistakenly I thought it would be easy to field map with an Xprofile field to automatically assign a member type to a new registrant. Wrong. After searching for a bit, I found out it is actually not possible to map a dropdown or radio button.
I really wanted to keep using the Gravity Forms User Registration, so the client could collect payments and BuddyPress, since I had customized some of the member areas.
There are lots of solutions to this with more advanced code and possibly using Gravity Form field auto-populating, however I found a solution that I could teach a tech-minded assistant without any code and without installing a full-blown membership plugin.
The beginning steps:
- Add the Member Types (via plugin or code in your function.php or your bp-custom.php)
- Install the BuddyPress Xprofile Member Type Field
- Go to “Users > Extended Profile”: Add a new field and for ‘Type” select “Single Member Type” and save.
After you have the beginning steps compete, edit your registration form. Here I have a required product field with 3 radio button options, one for each tier:
Next, add a “Single Line Text Field” for each member tier. Be sure to give it a simple label that you’ll recognize. Go to the advanced settings.
- First set the default value. This is a very important step. If this does not match the name of the tier, it will not work. I recommend each tier have a one word title, just to make life easier.
- Then select “Visibility > Hidden”.
- And finally, Check “Enable Conditional Logic” to “Show if All match: “Select your Product Tier field” > “Select the Tier this Field is for”. For example, my affiliate tier hidden field looks like this:
Once you have a hidden field set for each tier, save your form and head to your Gravity Form’s “User Registration” settings. You’ll need to set up a feed for each tier:
Open each feed and set up your settings per usual, except for one part. Under the “BuddyPress Profile” section, be sure to select the “Member Type” field you created in the beginning. Each feed should match member type, so here’s what my affiliate member feed looks like:
Before updating the settings of each individual tier feed, you have one more setting. Enable a condition for each feed to run only if the registrant selected the corresponding tier. Again, how this looks for my affiliate member set up: