יצירת סיסמא משדה מייל או טלפון בווקומרס

PHOTO EMBED

Fri Sep 10 2021 11:42:02 GMT+0000 (UTC)

Saved by @Zamzamon

//Use user email address as auto generated password

function wcs_filter_password_email( $args ) {
    $args['user_pass'] = $args['user_email']; //change user_email to whatever checkout field you want
    return $args;
}
add_filter( 'woocommerce_new_customer_data', 'wcs_filter_password_email' );

//Use user email address as login

add_filter( 'woocommerce_new_customer_data', function( $data ) {
	$data['user_login'] = $data['user_email']; //change user_email to whatever checkout field you want
	return $data;
} );
content_copyCOPY