From ca44110f3de996dc0e46adf520fa3c2c349666e9 Mon Sep 17 00:00:00 2001 From: terence1990 Date: Wed, 20 Jul 2016 14:26:14 +0100 Subject: [PATCH 1/2] Fix: ship_to_different_address --- includes/class-wc-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index c6d95c18e6b..ca39a1ce2d8 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -376,7 +376,7 @@ class WC_Checkout { $this->posted['createaccount'] = isset( $_POST['createaccount'] ) && ! empty( $_POST['createaccount'] ) ? 1 : 0; $this->posted['payment_method'] = isset( $_POST['payment_method'] ) ? stripslashes( $_POST['payment_method'] ) : ''; $this->posted['shipping_method'] = isset( $_POST['shipping_method'] ) ? $_POST['shipping_method'] : ''; - $this->posted['ship_to_different_address'] = isset( $_POST['ship_to_different_address'] ) ? true : false; + $this->posted['ship_to_different_address'] = isset( $_POST['ship_to_different_address'] ) && ! empty( $_POST['ship_to_different_address'] ) ? true : false; if ( isset( $_POST['shiptobilling'] ) ) { _deprecated_argument( 'WC_Checkout::process_checkout()', '2.1', 'The "shiptobilling" field is deprecated. The template files are out of date' ); From d2754a00813c59c5b6c8e1c875f88be7cae42c82 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 22 Jul 2016 12:59:51 +0100 Subject: [PATCH 2/2] Simpler logic --- includes/class-wc-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index ca39a1ce2d8..8503c44177b 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -376,7 +376,7 @@ class WC_Checkout { $this->posted['createaccount'] = isset( $_POST['createaccount'] ) && ! empty( $_POST['createaccount'] ) ? 1 : 0; $this->posted['payment_method'] = isset( $_POST['payment_method'] ) ? stripslashes( $_POST['payment_method'] ) : ''; $this->posted['shipping_method'] = isset( $_POST['shipping_method'] ) ? $_POST['shipping_method'] : ''; - $this->posted['ship_to_different_address'] = isset( $_POST['ship_to_different_address'] ) && ! empty( $_POST['ship_to_different_address'] ) ? true : false; + $this->posted['ship_to_different_address'] = ! empty( $_POST['ship_to_different_address'] ); if ( isset( $_POST['shiptobilling'] ) ) { _deprecated_argument( 'WC_Checkout::process_checkout()', '2.1', 'The "shiptobilling" field is deprecated. The template files are out of date' );