This article will show you how to add a cancellation confirmation button to WooCommerce Subscriptions. WooCommerce Subscriptions is a great way to offer subscription based products on a WordPress website, but if a user goes to cancel their subscription, this happens instantly. When cancelling, many users don't understand that this is an irreversible action, and after the pending cancellation., their data is removed from the website. What that means is that they will need to resubscribe to a subscription if they ever want to receive it in the future. If prices change, they won't be grandfathered into the previous subscriptions price.
To clarify, the standard behavior of cancellation in WooCommerce Subscriptions is this. The customer navigates to the my account dashboard, goes to the individual subscription, clicks cancel, and it is immediately cancelled.
This behavior isn't great, especially because there is a suspend feature that places the subscription on hold. This is very similar to canceling a subscription, except when you suspend it, all data remains in place, and the customer can reactivate the subscription at any time.
In many situations, suspending a subscription is great for both the consumer and the business. The business retains all the information on the customer, and the customer is incentivized to come back to the subscription when they need it or can afford it again.
To push customers to suspend their subscription instead of canceling, it makes sense to add a confirmation popup to the WooCommerce Subscription cancel button. Ascentia Lee, when somebody clicks on the cancel button under WooCommerce Subscriptions, instead of immediately canceling the subscription, it displays a popup prompting them to suspend it instead. While the customer can then go ahead and click OK, still canceling the subscription, in many cases they abort the cancellation, and decide to suspend.
Installing the following code on your WordPress website will make a JavaScript popup display when clicking on the cancellation button. This shows a quick confirmation message asking if they truly want to cancel, and if they would consider suspending the subscription instead. If they click OK, the cancellation goes through. If they click cancel, the cancellation does not go through and they are able to click this is spend button on the WooCommerce Subscriptions account dashboard.
Installing this code is very easy, you can add it to your functions.php file, by using code snippets, where by using Advanced Scripts (our review). Advanced Scripts is our recommended method of installing any and all code snippets on a WordPress website as it makes it very easy to do so. Simply copy and paste this into a new Advanced Scripts entry, select PHP, insert it into the WP-head and test out the behavior on the front end of your website.
After installation, when clicking cancel, a confirmation message will pop up, prompting a user to suspend their WooCommerce Subscription instead of cancel it.
Is it possible to add a pop-up cancellation form here or a shortcode to a form rather than just a message?
Great question. Yes, but it's very complex. We are building an internal plugin for a client project and may sell it publically if it works out.
Hi James! Thank you! Exactly what I need 🙂 Is it possible to also include a vimeo video in the popup?
Not with this snippet, but we're in the process of making a plugin that will be able to show video, Calendly, and other things to hopefully keep more subscribers! Being modified from something we've purpose built for a client who asked the same thing. I'll respond to this comment when it's out!
Hi James, I'm looking forward to a plugin as you've described. Is there an email list I can subscribe to for updates?
Hey Jacob - I'll send a notif out to the general email list and also RE here. You'll definitely know when it's launched 🙂 any feature requests?
One functionality that would be quite complex but also valuable is a way to provide a discounted rate to a user who is in the cancellation process, to see if a lower cost will keep them active. My initial thought was it could be a visible coupon code but ideally would apply it to their subscription automatically.
Hello
When i choose "cancel" in popup, the subscription is still canceled.
Did you ever get that plugin created to do this? I'd love to just redirect to a new page rather than throw a modal, if at all possible.
Would also love to the see the plugin. One big feautre for use would be to ask the reason for cancelation. Like price, don't need it anymore, ... And safe the results somewhere (best including emails/UserID/ ordernumber) or something like that.
Hello there,
we just tried to add the snippet on our WP site (via code snippets). But the pop up is not appearing when clicking the cancel button. Any idea what could be the problem here?
This snippet works perfectly. Thank you so much James.
This doesn't appear to work anymore. Are you able to confirm? Thanks for your help