Populate $current_user when users create an account during checkout

This commit is contained in:
Lee Willis 2013-01-22 21:30:14 +00:00
parent 1cb13fe740
commit 57af52f43d
1 changed files with 5 additions and 2 deletions

View File

@ -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( '<strong>' . __( 'ERROR', 'woocommerce' ) . '</strong>: ' . __( 'Couldn&#8217;t register you&hellip; 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 );