• Resolved igianni84

    (@igianni84)


    Hi everyone, I need to capture the password chosen by the user when registering on WooCommerce.

    I need it because I have to (through API or Webhook) register the users who buy my product, even on an external platform … and I have to do it using the same password that they chose when registering / buying on WooCommerce.

    How can I do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi;

    Test this snippet, I don’t test but should be work

    
    add_filter( 'woocommerce_registration_errors', 'ywp_get_password_on_registration', 999, 3 );
    function ywp_get_password_on_registration( $reg_errors, $sanitized_user_login, $user_email ) {
    
    	if ( empty ( $reg_errors ) )
    	        $_SESSION['current-upass'] = $_POST['password'];
    
    	return $reg_errors;
    }
    Thread Starter igianni84

    (@igianni84)

    Thanks so much. Where should I add this code? In which file?

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Just to clarify, with this code you will still need to actually write all the integration code for your external service, this will not do that. This will grab the user password only.

    We highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Capturing the password when registering a WooCommerce user’ is closed to new replies.