pmpro-woocommerce icon indicating copy to clipboard operation
pmpro-woocommerce copied to clipboard

Don't Cancell Membership when WooCommerce Subscription is OnHold

Open contemplate opened this issue 7 years ago • 4 comments

Every time this plugin is updated I go in and comment out this line:

add_action( "woocommerce_subscription_status_on-hold", "pmprowoo_cancelled_subscription", 10 );

Most subscriptions are On-Hold if there is a payment issue and the system will automatically be retrying and many times be successful after a few times and change the status to active. If not it changes the subscription to "expired" I believe which is fine then to have the membership removed. Almost all of my clients don't want their customers losing access during the On-Hold status.

Is there a way we can make this optional?

contemplate avatar Jun 13 '18 16:06 contemplate

This seems reasonable. I wonder if there is consensus on this from PMPro WC users. Could make sense to add it as an option. We're kind of compiling a lot of potential options/etc based on how people are using PMPro and WC together.

In the meantime, you could remove_action in some custom code for now. So add this to a custom function so you don't have to edit the plugin file each time.

function init_disable_pmprowoo_cancel_on_hold() {
    remove_action( "woocommerce_order_status_on_hold", "pmprowoo_cancel_membership_from_order" );
}
add_action( 'init', 'init_disable_pmprowoo_cancel_on_hold' );

ideadude avatar Jun 14 '18 17:06 ideadude

Thanks @ideadude

Yes making an options screen to decide which WC Subscription statuses trigger addition or removal of membership would be amazing!! More and more I'm switching over to allows WC Subscription manage all payments but need it to play nicely with PMPro, thus all the pull requests here ;)

I currently have about 5 clients on a PMPro + WC + WC Subscriptions setup with more coming. They all want this turned off. I'll implement this function for now. Thanks!

contemplate avatar Jun 14 '18 19:06 contemplate

I'm having the issue where I want to prevent 'On-hold' subscription status members from having Paid Memberships Pro access. Right now we're manually adding in customers from an old membership platform. When we add members manually they are set to a manually renew. So when a customer doesn't pay they are on hold and still have access, which is a loophole for free content. Hope more options for this come soon!

ninjaval avatar Sep 04 '18 22:09 ninjaval

The functionality to cancel or remove a membership level was implemented in the PMPro Woocommerce Add On Version 1.7.4

Removing this functionality can be done by following Jason's suggestion for the time being.

This seems reasonable. I wonder if there is consensus on this from PMPro WC users. Could make sense to add it as an option. We're kind of compiling a lot of potential options/etc based on how people are using PMPro and WC together.

In the meantime, you could remove_action in some custom code for now. So add this to a custom function so you don't have to edit the plugin file each time.

function init_disable_pmprowoo_cancel_on_hold() {
    remove_action( "woocommerce_order_status_on_hold", "pmprowoo_cancel_membership_from_order" );
}
add_action( 'init', 'init_disable_pmprowoo_cancel_on_hold' );

JarrydLong avatar Oct 05 '22 10:10 JarrydLong