diff --git a/classes/class-wc-checkout.php b/classes/class-wc-checkout.php index 33a4d25e980..2969775d379 100644 --- a/classes/class-wc-checkout.php +++ b/classes/class-wc-checkout.php @@ -359,7 +359,7 @@ class WC_Checkout { * @return void */ public function process_checkout() { - global $wpdb, $woocommerce; + global $wpdb, $woocommerce, $current_user; $woocommerce->verify_nonce( 'process_checkout' ); @@ -623,6 +623,9 @@ class WC_Checkout { if ( ! $this->customer_id ) throw new MyException( '' . __( 'ERROR', 'woocommerce' ) . ': ' . __( 'Couldn’t register you… please contact us if you continue to have problems.', 'woocommerce' ) ); + // Set the global user object + $current_user = get_user_by ( 'id', $this->customer_id ); + // Action do_action( 'woocommerce_created_customer', $this->customer_id ); @@ -795,4 +798,4 @@ class WC_Checkout { return $woocommerce->customer->get_shipping_postcode() ? $woocommerce->customer->get_shipping_postcode() : ''; } } -} \ No newline at end of file +}