Basic Custom Upgrade Flow - YourMembers/yourmembers GitHub Wiki
Having built a registration flow, the next potential step is to build an upgrade flow, for those users wishing to change package or who have expired. Please note this tutorial assumes you have read the basic registration flow tutorial
To create a simple upgrade button you don't need to make use of registration flows simply use the shortcode:
[ym_upgrade id=xx]
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

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, 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.
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.