How To Disable Payments on WooCommerce

A jar of coins

Let’s say that you have a website with a shop on WooCommerce.

You only allow customers to place orders on the site without taking payments because you handle them separately in your accounting software, or maybe via phone or in another way.

You will have the need to disable all payment gateways on the site, but just disabling them in WooCommerce > Settings > Payments will not work because then the customers will get an error message since there are no payment methods available.

What you need is a snippet of code that marks all order not in need of payment.

Add this code to your functions.php file in wp-content/themes/your-child-theme-name/:

add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
view raw functions.php hosted with ❤ by GitHub

More Posts That You Might Like…


2 responses to “How To Disable Payments on WooCommerce”

  1. Thank you, it’s really helpful for my local store site.

  2. I wish I could see your post sooner. It is really helpful for my Woocommerce site. Thanks for sharing!

Leave a Reply

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Blog at WordPress.com.

%d bloggers like this: