Would you like to set the default subscription plan by passing an URL parameter to forms?
Imagine you have a subscription form with a plan selector containing several subscription plans.
If you’d like to set the default subscription plan by passing an URL parameter, like on the screenshot below, then this article is for you:
If you’d like to set the default subscription plan of your subscription form via an URL parameter, then you have to do the following:
The following subsections explain these steps in detail.
You have to pass the recurring id in the wpfsPlan parameter (it will select the Silver plan): https://demo.paymentsplugin.com/sell-recurring-services-inline/?wpfsPlan=price_1JmD2iKit80XPxkD8jLNNvVM
You can obtain the recurring price id under the “Products” menu on the Stripe dashboard, in the “Pricing” section of the product details page:
For the sake of security, the plugin doesn’t let anyone set the default subscription plan without your consent.
You can give consent by implementing a short piece of code to approve the plan in the form of a Wordpress filter. The code needs to be added to the functions.php file of your active Wordpress theme.
This is the default implementation:
You can customize the code depending on your needs. For example, you can limit the default plan based on form name and recurring price id:
Our support team is happy to help you.Contact support
Feature requests are always welcome!
We consider each feature request carefully, and examine how it fits the roadmap for the plugin.