From c14993b90e82ba3079a9120feb4158dc5390ba8c Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 25 May 2016 12:05:11 +0100 Subject: [PATCH] No shipping methods = no shipping at checkout #10987 --- includes/class-wc-cart.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 4beb6089b8f..fbdb9dd3007 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1505,7 +1505,8 @@ class WC_Cart { * @return bool whether or not the cart needs shipping */ public function needs_shipping() { - if ( ! wc_shipping_enabled() ) { + // If shipping is disabled or not yet configured, we can skip this. + if ( ! wc_shipping_enabled() || 0 === wc_get_shipping_method_count( true ) ) { return false; }