Note: This content is more than one year old. It may not contain the most up to date information.
Restrict Content Pro allows members to upgrade or downgrade their subscriptions, but sometimes people ask for ways to tweak the way it works. Sometimes they want to: prevent members from downgrading to cheaper subscriptions, prevent members from upgrading to more expensive subscriptions, prevent members from changing their subscriptions at all, or prevent members from getting a prorated credit when switching their subscriptions. Let’s take a look at the ways to handle all these scenarios.
Preventing all subscription changes
If you don’t want your members to be able to change their subscriptions from one level to another, you can easily prevent them from doing so with a simple line of code:
add_filter( 'rcp_can_upgrade_subscription', '__return_false' );
With the above line of code, RCP will not allow members to change their subscription level. Instead, they will be met with a message stating: You are already registered and have an active subscription
.
That’s all there is to it.
Disabling proration credits when changing subscriptions
If you don’t want members getting a prorated price when changing subscriptions, you can easily do that with a single line of code:
add_filter( 'rcp_disable_prorate_credit', '__return_true' );
With the above line of code, RCP will not credit members for payments made to their existing subscription level. Instead, they will be charged the full price for the new subscription level.
Preventing downgrades to lower-priced subscriptions
If you don’t want your members to be able to change their subscription to a subscription that costs less, you can do that with a few lines of code.
https://gist.github.com/mindctrl/20ba6ab4a25ec0e0f4369231239febc2
The above code will remove subscription levels from the registration form that cost less than a member’s existing subscription, which will prevent them from downgrading to a lower-priced subscription.
Preventing upgrades to higher-priced subscriptions
If you don’t want your members to be able to change their subscription to a subscription that costs more, you can do that with a few lines of code:
https://gist.github.com/mindctrl/b2c498e4fbdc946674a010c2d985c6cd
The above code will remove subscription levels from the registration form that cost more than a member’s existing subscription, which will prevent them from upgrading to a higher-priced subscription.
Summary
As you can see, Restrict Content Pro is very flexible, and in many cases can be customized with just a few lines of code. The above examples cover the most common use cases for adjusting the behavior of subscription upgrades and downgrades. You can go deeper and have even more granular control if needed. Go forth and customize upgrades and downgrades to your liking.