user_register action hook not returning customer lookup detail

31 views Asked by At
add_action('user_register', 'registration_save', 10, 1);

function registration_save($user_id)
{
    global $wpdb;
         
    $customer = $wpdb->get_row("SELECT customer_id FROM $wpdb->prefix" . "wc_customer_lookup where user_id=$user_id");

    if($customer){
        // fetch customer information 
        // not able to get the customer details here , which hook is better to fetch customer look up information after user registration ?
    }
}

Using the above hook , I try to fetch customer lookup table data , but at this point customer lookup data is not updated with registered user , which hook is suitable to get customer lookup after user registration. Kindly advice , Thanks

I try to fetch customer data from wc_customer_lookup table inside this code but its not working , also tried other hooks 'woocommerce_created_customer' and filters 'registration_redirect' but none of this return customer_lookup information.

0

There are 0 answers