• Resolved Avrom

    (@dividendninja)


    This plugin would be perfect if there was a toggle to disable WooCommerce Subscription products. Since that requires Reference Transactions enabled. Otherwise great plugin.

    Is there any code snippet that can be used for that?

    • This topic was modified 11 months, 4 weeks ago by Avrom.
Viewing 1 replies (of 1 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @dividendninja

    Here is a code snippet that filters PayPal if there is a subscription in the cart.

    add_filter('woocommerce_available_payment_gateways', function($gateways){
    	if(is_checkout()){
    		if(function_exists( 'wcs_is_subscription' ) &&  \WC_Subscriptions_Cart::cart_contains_subscription()){
    			unset($gateways['ppcp']);
    		}
    	}
    	return $gateways;
    });

    Kind Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Disable Subscriptions’ is closed to new replies.