Answer the question
In order to leave comments, you need to log in
How to login to woocommerce using mobile phone?
Hello! There is a woocommerce store .
How to make such an implementation so that the user entering his mobile phone (without entering SMS) can log in to the site or, if not registered, register, as in the picture below.
Prompt, please, in what direction to dig? Is it possible?
Answer the question
In order to leave comments, you need to log in
Like this
$order = new WC_Order($order_id);
$order_email = $order->billing_email;
$email = email_exists( $order_email );
$user = username_exists( $order_email );
$random_password = wp_generate_password();
$userdata = array(
'user_pass' => $random_password,
'user_login' => $order_email,
'first_name' => $order->billing_first_name,
'user_email' => $order_email,
'role' => 'customer',
);
$userid = wp_insert_user( $userdata );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question