Creating Custom Upgrade Flows - YourMembers/yourmembers GitHub Wiki

Building a simple upgrade button

To create a simple upgrade button you don't need to make use of registration flows. Simply use the shortcode:

[ym_upgrade id=xx]

Where xx is the ID of the package for example id=3 for package 3. This will create a button which will process the payment (if there is one) and add the user to the appropriate package.

Build a simple upgrade flow

We can do the same using flows the advantage of flows is we can then build more complex upgrade processes.

Upgrade flows use the custom registration flow feature, but unlike initial registration you don't need to add email, user login or indeed any user data.

To recreate the standard upgrade button go to Membership -> Registration Flows Create a new flow page Select payments, and the payment method you want your upgrade to use and choose the action to be "button" Give it a name and Save.

Next create a Flow, select the page you created drag it over Give it a name and Save, jot down the flow id.

Now to make use of this flow use the following shortcode


[ym_register id=xx flow=xx]

Where id is your package and the flow is the flow ID.

The above recreates the simple upgrade button, and as you can see it's a lot more work to get the same result, but we can use the above code as a basis for more complicated upgrade flows.

Collecting additional user details

The advantage of using flows for upgrades is you can collect additional information. For example you can collect additional custom field data that you did not collect during registration. It's important to remember that custom registration flows will overwrite any existing data so you must make sure a user entering a custom registration flow does not have email, login or password fields exposed to them, or they will be overwritten.

To collect additional data you will need to create a separate flow page to the payment button. You cannot have any data collection on a payment page. You may also want to change the payment action from payment button to payment action. So once the form is completed they are taken straight to payment processing.

⚠️ **GitHub.com Fallback** ⚠️