@eyewayonline
The issue you described is completely reproducible on my environment.
Hello, whenever we enter email id on register my-account form, it resets the cart and customer loose all its items in the cart. I tried to resolve the issue by enabling “Custom logout function” option available on the Advanced section, as mentioned here. But the issue is still there. Kindly assist further.
I have changed the Login prevention method from “logout right after login” to “Use login filter from woocommerce”. The issue got resolved but this method prevents system to send account creation mail to the customer that also contain verification link. It is also verifying the customer automatically without pressing any verification link.
I solved the issue by disabling the Prevent login after register completely on plugin settings first. Then I manually prevent login after register behaviour via adding below filter to my child theme’s functions.php ;
add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );
P.S. If you want to redirect the customer to checkout page right after e-mail verification completed you can use below code in your child theme’s functions.php ;
add_action('template_redirect', 'redirect_if_activation_message_and_cart');
function redirect_if_activation_message_and_cart() {
// Check if it's the my account page
if (is_account_page()) {
// Check if the URL has the success activation message
if (isset($_GET['alg_wc_ev_success_activation_message']) && $_GET['alg_wc_ev_success_activation_message'] === '1') {
// Check if the WooCommerce cart is not empty
if (!WC()->cart->is_empty()) {
// Redirect to the checkout page
wp_safe_redirect(wc_get_checkout_url());
exit;
}
}
}
}
Hope this helps, great plugin!