No shipping methods = no shipping at checkout

#10987
This commit is contained in:
Mike Jolley 2016-05-25 12:05:11 +01:00
parent 4b2bf266ca
commit c14993b90e
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}