Why requiring current users to log in is the default behaviour?
-
Hello!
If a customer tries to checkout with an email address tied to an existing account, they cannot complete their purchase without logging in. This is bad for conversions.
Before altering this, I would like to ask why this is the default way to handle this in WooCommerce? Why can’t they just checkout without getting their order tracker OR track it to their existing account even if they haven’t logged in?
Just trying to understand if there are very good reasons for this and if I shouldn’t change how it works.
(I have found this piece of code that should make it possible. Any risks in using this? Looks pretty clean to me
add_action('woocommerce_checkout_process', function () { if (!is_user_logged_in() && $_POST['billing_email'] && $_POST['createaccount'] == 1) { $user = get_user_by('email', $_POST['billing_email']); if ($user) wp_set_current_user($user->ID); } });
)
Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Why requiring current users to log in is the default behaviour?’ is closed to new replies.