• Resolved eyewayonline

    (@eyewayonline)


    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.

    Thank You.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @eyewayonline,

    I am really sorry to know you are experiencing problems.

    I have escalated this with our development team. They will get back to you as soon as they can.’

    Kind regards.

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Hi @eyewayonline ,

    In that case, please try to change the option “Advanced > Prevent login after register > Login prevention method“.

    Let me know if it helps.

    Thread Starter eyewayonline

    (@eyewayonline)

    Hi @karzin

    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.

    kindly assist

    Plugin Contributor Pablo Pacheco

    (@karzin)

    If the customer is being verified automatically, maybe it makes sense there is no email being sent, if the plugin thinks that user doesn’t need to be verified. Can you please make sure that the user trying to register doesn’t have the role matching the option General > Account verification > Ignore user roles?

    @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!

    • This reply was modified 6 months, 2 weeks ago by Hasan ?ALI?IR.
    Plugin Contributor Pablo Pacheco

    (@karzin)

    Thanks @psauxit ??

    But if the option Advanced > Prevent login after register > Login prevention method is set as Use login filter from woocommerce, the plugin will do exactly as your suggestion:

    add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );

    Regarding the other part of the code, I believe our option General > Redirect on success would be enough.

    You are welcome @karzin

    As @eyewayonline mentioned somehow this setting on plugin not work as expected and breaks some other functionality.

    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.

    Suprisingly manually preventing auto login after register behaviour instead of relying plugin setting solves the issue on my side. For your investigation.

    Best ~Hasan

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Thanks again @psauxit ,

    I couldn’t reproduce the issue at all here. Let’s leave your suggestion as solution then. I’m going to mark it as resolved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cart gets empty after customer registration’ is closed to new replies.