From 58679cb50e60e321ff08956daef0ab00ae0d5b87 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 26 Mar 2012 20:16:05 +0100 Subject: [PATCH] Additional isset checking closes #837. --- classes/class-wc-checkout.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/classes/class-wc-checkout.php b/classes/class-wc-checkout.php index 4211f59f6f8..d5c77e01198 100644 --- a/classes/class-wc-checkout.php +++ b/classes/class-wc-checkout.php @@ -179,19 +179,25 @@ class WC_Checkout { $woocommerce->customer->set_postcode( $this->posted['billing_postcode'] ); // Shipping Information - if (!$skipped_shipping) : + if ( ! $skipped_shipping ) : // Update customer location to posted location so we can correctly check available shipping methods - $woocommerce->customer->set_shipping_country( $this->posted['shipping_country'] ); - $woocommerce->customer->set_shipping_state( $this->posted['shipping_state'] ); - $woocommerce->customer->set_shipping_postcode( $this->posted['shipping_postcode'] ); + if ( isset( $this->posted['shipping_country'] ) ) + $woocommerce->customer->set_shipping_country( $this->posted['shipping_country'] ); + if ( isset( $this->posted['shipping_state'] ) ) + $woocommerce->customer->set_shipping_state( $this->posted['shipping_state'] ); + if ( isset( $this->posted['shipping_postcode'] ) ) + $woocommerce->customer->set_shipping_postcode( $this->posted['shipping_postcode'] ); else : // Update customer location to posted location so we can correctly check available shipping methods - $woocommerce->customer->set_shipping_country( $this->posted['billing_country'] ); - $woocommerce->customer->set_shipping_state( $this->posted['billing_state'] ); - $woocommerce->customer->set_shipping_postcode( $this->posted['billing_postcode'] ); + if ( isset( $this->posted['billing_country'] ) ) + $woocommerce->customer->set_shipping_country( $this->posted['billing_country'] ); + if ( isset( $this->posted['billing_state'] ) ) + $woocommerce->customer->set_shipping_state( $this->posted['billing_state'] ); + if ( isset( $this->posted['billing_postcode'] ) ) + $woocommerce->customer->set_shipping_postcode( $this->posted['billing_postcode'] ); endif;