Checkout

WooCommerce Disable Place Order Button If There Are No Shipping Methods Available

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

This snippet allows you to completely remove the place order button if there are no available shipping methods on the checkout.

function ecommercehints_disable_place_order_if_no_shipping_methods() {
$shipping_methods = WC()->shipping->get_shipping_methods();
	if (!$shipping_methods) {
		remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
		}
}
ecommercehints_disable_place_order_if_no_shipping_methods();

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 20% off on your first month with us.

26027
WELCOME OFFER