How to disable/remove certain payment option from WooCommerce checkout?
If you’re rendering a service or selling integral goods, there are chances you don’t want your customers to use a particular payment method or any payment options at all on your checkout page.
How do you go about this, so it doesn’t force the user to either use a specific method or any payment gateway?
Don’t worry! We are here for you.
We’re going to hold you by the hand and show you a super easy way to not only remove a certain payment method, but to also remove all payment options without breaking your site or pulling your hair off.
First, let take a look at how to change a specificpayment method on the checkout page.
How to Change a Specific Payment Method on Checkout Page?
This is how your default checkout screen will look like at first:
In the above screenshot, you can see all the default payment gateways are all intact.
The next step now is to remove a specific payment method. Let’s say we want to remove cheque payment. Yes, cheque payment will be fine. Let’s go with that.
- The first step is to login to the Back-end of your site. Click the settings link under WooCommerce menu.
- Then, head straight to the checkout tab where you’ll see all the payment methods and their settings.
- Here’s how it looks like in the screenshots below:
4. To remove the check payment method, click on the cheque link. Here you’ll see the checkbox marked as checked. This checkbox will determine whether to enable/disable check payment option.
5. Now, Uncheck the cheque payment box and save changes.
- After that, go straight to the front end of your site, and refresh the checkout page. The cheque payment method will automatically disappear from your website.
Here’s how your webpage will now look like.
Awesome, right? With this simple method you can easily disable any payment gateway of your choice.
With that out of the way, let’s look out how to disable all payment methods on your checkout page.
How to Remove all Payment Methods?
We’re going to be using a different method here. The way to go is to add just a single line code to the functions.php file within your theme folder.
You can decide to use a plugin called code snippet.
Add to Functions.php
And Voila! The checkout page will now display only a “Place Order”button.
Pretty straightforward, right? Yeah, that’s how it is. I hope you have found this article very useful. Let me know if you want any further assistance.
Remove Default WooCommerce Payment Gateways
By default, WooCommerce 2.2.8 ships with five payment gateways:
- BACS (Bank Transfer/Wire)
- Pay by Check (or Cheque)
- Cash on Delivery
- Simplify Commerce
If you want to have only one payment gateway available on the Checkout page, the unused payment gateways can be disabled in the admin settings.
This will hide the payment gateway from the customer on the Checkout page, but what if you want to hide the payment gateway from your client who has access to the WordPress dashboard?
Remove Default WooCommerce Payment Gateways
The first thing to know about payment gateways in WooCommerce is that they are handled by the WC_Payment_Gatewaysclass. In the init() method of this class an array named $load_gateways is populated with class names corresponding to the payment gateways to be loaded.
Then the filter ‘woocommerce_payment_gateways’ is used so that 3rd party gateways can register themselves as a gateway.
This same filter can be used with a higher (later) priority to remove unwanted gateways. The following gist shows a function filtering the gateway array and removing any class names that are in a $remove_gateway array.
The array can be expanded or reduced based on the gateways you want removed.
Now the admin dashboard will only display the desired payment gateways.
Remove WooThemes Helper Plugin Nag
While testing the previous gist, I used the WooCommerce Stripe plugin and I noticed an admin message that can’t be dismissed:
WooThemes plugins come with functionalty to check for the presence of the WooThemes Helper plugin. It will ask you to install it, if not already installed and activate it if it is inactive.
Unfortunately, this nag can’t be dismissed. If you’d rather manage your plugin licenses and versions manually, you can use the following gist to remove the unsightly message and make your Dashboard neat and tidy.
Get our best WooCommerce advice!
Delivered directly to your inbox
You’re in! Now check your email to confirm your subscription.
Daniel has been building ecommerce plugins and sites since 2007. He built the first commercial plugin for WooCommerce in 2011 and has built dozens of plugins and sites since.
Checkout our WooCommerce plugins at our plugin marketplace:
WooCommerce Braintree Payment Gateway
WooCommerce Braintree Payment Gateway allows you to accept credit card payments on your Woocommerce store via the Braintree gateway. It authorizes credit card payments and processes them securely with your Braintree merchant account.
- Easy to install and configure
- Compatible with WordPress/Woocommerce plugins
- You don’t need any extra plugins or scripts to process the transaction
- Accepts all major credit cards
- Automatic Payment Confirmation to update order transaction
- Very Simple Clean Code to add a Braintree payment method to woocommerce
Checkout Payment Form is responsive, adapts nicely to all mobile screen sizes.
Configuring this addon is very easy. Simply go to the following WooCommerce settings area to enable the Braintree gateway and enter your Braintree API details:
WooCommerce Settings -> Checkout -> Braintree
You can find detailed usage instruction with screenshots on the Braintree Gateway for WooCommerce extension page.
After that, your customers will be able to select the credit card checkout option on the WooCommere checkout page.
This Plugin does notsupport WooCommerce Subscriptions, but this functionality is in plan for the near future.
Github repository — https://github.com/wp-insider/woocommerce-braintree-payment-gateway
- Configuration page with options for the Plugin.
- Frontend shop Checkout page Payment Form.
- Login to your WordPress Admin area
- Go to «Plugins > Add New» from the left hand menu
- In the search box type «WooCommerce Braintree Payment Gateway»
- From the search result you will see «WooCommerce Braintree Payment Gateway» click on «Install Now» to install the plugin
- A popup window will ask you to confirm your wish to install the Plugin.
- Download the plugin zip file
- Login to your WordPress Admin. Click on «Plugins > Add New» from the left hand menu.
- Click on the «Upload» option, then click «Choose File» to select the zip file from your computer. Once selected, press «OK» and press the «Install Now» button.
- Activate the plugin.
- Open the Settings page for WooCommerce and click the «Checkout» tab.
- Click on the sub tab for «Braintree».
- Configure your «Braintree» settings. See below for details.
Configure the plugin
To configure the plugin, go to WooCommerce > Settingsfrom the left hand menu, then click «Checkout» from the top tab menu. You should see «Braintree»as an option at the top of the screen. Click on it to configure the payment gateway.
- Enable/Disable— check the box to enable Braintree Payment Gateway.
- Title— allows you to determine what your customers will see this payment option as on the checkout page, default is «Credit card».
- Description— controls the message that appears under the payment fields on the checkout page.
- Sandbox— check the box to enable sandbox mode to test how would payments work for you, real payments will not be taken. Uncheck this option to put It in production mode.
- Sandbox Merchant ID/Merchant ID— enter your Braintree Merchant ID, this is gotten from your account page on Braintree website.
- Sandbox Public Key/Public Key— enter your Braintree Public Key, this is gotten from your account page on Braintree website.
- Sandbox Private Key/Private Key— enter your Braintree Private Key, this is gotten from your account page on Braintree website.
- Click on Save Changesfor the changes you made to be effected.
Часто задаваемые вопросы
Does this Plugin support WooCommerce Subscriptions?
No, It doesn’t, but this functionality is in plan for the near future.
Does this plugin require the SSL?
As an online merchant, it is your responsibility to make sure the information you collect from your customers is protected so yes, you need it.