Merge pull request #2270 from leewillis77/master
Populate $current_user when users create an account during checkout
This commit is contained in:
commit
a9154c07a4
|
@ -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’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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue