Skip to content

Instantly share code, notes, and snippets.

@thenbrent
Last active October 31, 2016 20:17
Show Gist options
  • Save thenbrent/6641526 to your computer and use it in GitHub Desktop.
Save thenbrent/6641526 to your computer and use it in GitHub Desktop.
Using WooCommerce and want to disable PayPal for subscription purchases, but still offer it as an option for buying one-off products? Activate this plugin.

This gist has been migrated to a repo here.

@infitechelectronics
Copy link

I was able to do it, just created a new folder inside the wp-content/plugins folder, named: "woocommerce-disable-paypal-for-subscriptions" and placed the woocommerce-disable-paypal-for-subscriptions.php file with the code above inside the folder. Just a comment: the code is missing the ?> at the end.

Then simply go to your plugins in WordPress and activate it!

Sorry if this is too simple, but it may help others :)

@caschen
Copy link

caschen commented May 31, 2015

Hi,
Does this plugin still allow existing active subscriptions to be renewed via Paypal? Will it only stop new Paypal customers subscribing?
Thanks

@hxxrmonkey
Copy link

Thank you SO MUCH for this, spent hours trying to figure out where the form for a change of payment method with $0 balance was being pulled from so I could disable paypal there (successful initial signup with $0 due, and changing payment method before first renewal charge hits), and as a bonus stumbled upon a wealth of other snippets useful for for the sub plugin. Thanks! (I know you're the author, I wish I had bothered to look here first before I spent hours sorting through code... have bookmarked it now!)

@douglsmith
Copy link

An update for others who may find this, the shorter solution I posted above no longer works in Subscriptions 2.x.

@robin-scott
Copy link

This plugin works with 2.0 though? We're just adding it to a site which is heading towards 2.0.

@robin-scott
Copy link

Okay, this works, in checkout, but has been pointed out today that it doesn't remove it from the "Update Payment" screen in My Account > Subscriptions. About to roll sleeves up and add that... unless anyone has already fixed that?! ;)

@thenbrent
Copy link
Author

Hi folks, given the amount of discussion on this gist, I'm moved it to a GitHub repo where it's history is more easily traced and we can use Issues etc. to track discussions. Find it here: https://github.com/Prospress/woocommerce-subscriptions-disable-paypal

@hoobsi
Copy link

hoobsi commented Oct 31, 2016

Good point by silicondales!
Does anyone know a way of how to also remove paypal in the MyAccount > Update Payment section? That would be amazing.
Sorry for posting on here thenbrent but I could not see any posts under the other link :/
Any help would be massively appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment