Please consider leaving a donation if you appreciate this information. Lightning network now available
Update 28 June 2018: The fine folks at Prospress have provided some updated code which works with newer versions of WooCommerce Subscriptions.
WooCommerce Subscriptions by default will move a subscription to a ‘pending cancellation’ status when cancelled either by the subscriber or the shop manager. The purpose of this is to provide access to a subscribed product for the remainder of time that it was paid for. This isn’t necessarily appropriate to physical products that are shipped – but it also has no detrimental effects in those cases except the possibility of subscribers who may be concerned that their subscription hasn’t actually been cancelled. If you wish to completly bypass the ‘pending cancellation’ status there are many ways that you could go about that and this is one of them using the Subscriptions provided action (dynamically) named woocommerce_subscription_status_pending-cancel – see the snippet below as an example:
Not sure what to do with code snippets? See What Do I Do With These Code Snippets?
Please consider leaving a donation if you appreciate this information. Lightning network now available
karockim says
Thank you for this helpful tip. It does work but when the user cancels a subscription, it redirects to a page which is plain white – it looks broken. Refreshing this page brings the content back along with a security notice. – Any idea how I could fix this?
Thanks!
will says
Seems there has been some changes to the Subscriptions code that makes this snippet cause a fatal error (the white screen that you are reporting). At this time I haven’t really got any suggestions other than to maybe use one of the WP_CRON type functions to schedule the cancellation rather than cancel “now”
karockim says
Thanks for your advice, much appreciated. It seems I have some learning to do, I don’t know this stuff too well but I will dig around and see what I can find.
Thanks again.