woocommerce hooks for registering new user and updating user

I need a function to execute add_new_user_details within my Woocommerce site but am struggling applying the relevant hook. I need to execute it after a new user places an order and adds billing info etc.

When I test the below by completing an order, it doesn’t seem to doing anything. I have tried using ‘woocommerce_order_status_processing’ and ‘user_register’ hooks.

    add_action( 'woocommerce_order_status_complete', 'add_new_user_details' );
    function add_new_user_details($user_id){
          $user_id = get_current_user_id();

          echo $user_id;

    }

Related posts

1 comment

Comments are closed.