diff --git a/plugins/woocommerce/changelog/fix-shipping-postcode-50800 b/plugins/woocommerce/changelog/fix-shipping-postcode-50800 new file mode 100644 index 00000000000..84f5873325b --- /dev/null +++ b/plugins/woocommerce/changelog/fix-shipping-postcode-50800 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix postcode validation within the legacy cart show_shipping method. diff --git a/plugins/woocommerce/includes/class-wc-cart.php b/plugins/woocommerce/includes/class-wc-cart.php index db8fefc926b..8c75b5fc4eb 100644 --- a/plugins/woocommerce/includes/class-wc-cart.php +++ b/plugins/woocommerce/includes/class-wc-cart.php @@ -1597,7 +1597,7 @@ class WC_Cart extends WC_Legacy_Cart { */ $postcode_enabled = apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true ); $postcode_required = isset( $country_fields['shipping_postcode'] ) && $country_fields['shipping_postcode']['required']; - if ( $postcode_enabled && $postcode_required && ! $this->get_customer()->get_shipping_postcode() ) { + if ( $postcode_enabled && $postcode_required && '' === $this->get_customer()->get_shipping_postcode() ) { return false; } }