Do you offer three different payment options for the same membership access? This new code gist allows you to easily add a selection box to the checkout page.

select-payment-plan

The code example below shows you how to define level “groups”—levels that are related and should appear as payment plans on the membership checkout page.


Video Demo


The Code Recipe

This code recipe requires a Plus Account or higher.

View Membership Options


Comments (16)

Hello,
I followed all the instructions in the article. But the code does not work!
I have the latest version of WordPress, PMPro …
I use the theme AVADA.

Thanks

Hi Guys – This is a great ad on, and a critical feature for my implementation as we allow users to choose between paying up front or monthly installments.

That said, I’m seeing two bugs and issues when entering a discount coupon code.

1. If a coupon code is entered, the prices displayed within the “select a payment” plan box are not updated. The full price is displayed there. The coupon is reflected in the “membership level” section but not below.

2. If a coupon is entered, and there is an error in the checkout form, and the page is refreshed, the discounted price IS reflected in the “select a payment” plan box, BUT one discounted price is displayed for BOTH radio button options.
For example, I created one coupon that both discounts the installment plan from $149/mo > $125/mo, and discounts the upfront option from $1640 > $1500. When this coupon is used, and the page is refreshed due to error, both “select a payment plan” checkboxes display as “$125 per month”, instead of one displaying “$1500 per year” and the other dispalying “$125 per month”

The good news is that the coupon code does seem to work, but there is a lot of opportunity for user confusion.

Thanks,
David

Thanks for pointing these out. It would take some work to update this to be able to update the option prices on the fly when discount codes are entered. I’m not sure if we’ll ever have time to get to that, but if a solution comes up on one of our consulting projects or someone elses I’ll be sure to publish the update.

Hi Jason,

I have created a Payment plan solution based on the above that updates the the price options when a discount is applied.

It is the basis of addon/plugin however it is incomplete. It still needs something on the admin side to group the membership levels which are currently hard-coded.

BTW the solution worked really well with the Subscription Delays addon. Very smooth. Nice work!

Payment Plan Remodelling
———————————-

However, having been looking under the bonnet for while, I believe that there is a more elegant solution which involves changing how the payment plan is modelled.

I believe you can model the payment plan in the same way as a discount (which is just a type of payment plan anyway).

This avoids having to create two or more identical memberships and group them together. It also models the real world more accurately as in reality there is only one membership (but with different payment profiles).

The only real difference been a payment plan and a discount is visibility – payment plan options are displayed always, a discount is displayed only when the coupon code is entered. Ultimately, we end up with a single membership and payment profile identified by the code_id.

In terms of the database this would just require adding ONE new field called code_type (enum ‘DISCOUNT’ or ‘PAYPLAN’) to the wp_pmpro_discount_codes table. No changes are required to the wp_pmpro_discount_codes_levels table or any other tables.

As regards the checkout page I would split the top pricing section into two; have a separate membership name section (title and description) at the top then have a separate pricing section with the one or more prices and discounts. It is also worthwhile adding another do_action hook after the membership name but before the pricing. I would also add a filter so the “You have selected…. so and so membership” can be easily overridden or suppressed.

Maybe payment plans could be discussed as one of the items on the next developer chat?

All the Best

Russell

It’s been a while since this was last updated. Any chance you are going to create a plugin/add-on for this instead of having to update the functions.php file?

So if I have 3 membership levels, but 3 payment plans for each, I would now have 9 different membership levels?
This seems super messy to me. I now have to worry about 9 sets of permissions, and checking 9 boxes instead of 3.

What happens if I add a new level to a group? Does it adopt the rest of the group’s permissions? Or do I need to go back and modify every page so that it includes this new level?

Or… is there any way to implement Russel’s suggestion? As he mentioned.. it’s mostly just about the way it’s displayed.

Hi I’ve been implementing this and it works great with a bit of fiddling. The only problem I’m finding is I have the donations add on implemented and would like to keep that, but my choices of levels now come below the donation dropdown which looks odd. I want to swap them around where in the code can I change this please or is it a case of adding a function in the pm-pro custom plugin?
Many thanks, James

Hello. I need this solution to offer a reduced annual rate compared to the monthly rate. There is something I do not understand. Where should I create the different payment plans. On the membership level setting page, you can configure only one plan. It’s just ? Where to tell others?

In the WP Dashboard, Memberships -> Membership Levels, you should be able to add more than one level. Make one have the annual price, and the other have the monthly price. Then get a developer (or the forums here) to help you setup this custom code so the levels look like a plan selection at checkout.

Thank you Jason for that answer. If I understand correctly, does that mean that I have to create two identical membership levels for which only the payment plan changes? So I will have to update each level as soon as I make a change to access permissions or any other component?

For the code, it should go, I think I can fend for myself.

Hi @algofae,

That is correct, you will need to make two identical levels with whatever different billing information you may want to offer. But the levels will have the same permissions when it comes to member only content.

Leave a Reply

Your email address will not be published. Required fields are marked *