• Hi,

    i have enabled double optin on my site.
    I need to have double option for login, but allow access to checkout.

    For this i use following code:

    function removeWooCommGER_doicheckout() {
    	global $wp_gdpr_wc_controller;
    	$wp_gdpr_wc_controller = new WC_GZD_Customer_Helper;
    	remove_action( 'woocommerce_checkout_init', array( $wp_gdpr_wc_controller, 'disable_checkout' ), 1 );
    }
    add_action('init', 'removeWooCommGER_doicheckout');

    Suddenly some Germanized error messages are displayed twice (under each other), for example, messages like – “Please activate your account through clicking on the activation link received via email.”

    Curiously following message is displayed only once – “Did not receive the activation email? Try again.”

    Thanks for your help

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    I need to have double option for login, but allow access to checkout.

    Why don’t you activate the soft-DOI-feature (disable the “deactivate login for inactive customer” option in the DOI settings)? Your adjustments won’t work that way.

    Cheers

    Thread Starter John Halflord

    (@honsi)

    Hi,

    not sure if these are the settings, that you mean – https://imgur.com/a/hvniUpZ

    If i deactivate the second option, the user can access the checkout, but also is automatically logged in and redirected to “my account” after registration.

    I need a double optin for login (user remains not logged in after redirect & receives email with password), but for guest to access checkout.

    Or do i have some plugin conflict, so Germanized does not work properly?
    My code above solves my problem, but the error messages gets displayed twice.

    Thanks

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    If i deactivate the second option, the user can access the checkout, but also is automatically logged in and redirected to “my account” after registration.

    Yes, that’s the soft-DOI option – the account will be deleted automatically after X days in case the customer does not complete the activation.

    I need a double optin for login (user remains not logged in after redirect & receives email with password), but for guest to access checkout.

    Guests are able to checkout even though you’ve got the DOI activated and leave the “Deaktiviere den Login & Checkout für inaktive Kunden” activated. The only difference is that the customer has to decide whether to do a guest checkout before going to the checkout.

    Cheers

    Thread Starter John Halflord

    (@honsi)

    Ok, thanks for the answer.

    In that case, i don’t actually like the functionality of the soft DOI. I don’t want to delete the inactive accounts.

    The options you have described is not what i need exactly.
    I don’t want to allow guest orders, i do however want to allow access for guests to checkout, where they can create an account.
    I want customers to be able to register and have to confirm their account, but i don’t want for them to be automatically logged in.

    I have actually solved all of these specifications, but the last code for allowing access to checkout started displaying the messages twice. Not sure why it’s displayed twice when i remove an action.
    This is what i would need to solve if the default options do not conform to my specifications.

    Sorry if this is a very specific case, but i would be very grateful if i could complete it with Germanized, as i use it for all the other Woocommerce optimizations.

    Plugin Author vendidero

    (@vendidero)

    Hi,

    I don’t want to allow guest orders, i do however want to allow access for guests to checkout, where they can create an account.

    Well the issue is that Woo does auto-login those customers created during checkout too because otherwise the (newly created order) will not be linked to the customer account.

    About your customizations: You are creating a new instance of the helper. Instead you should use $helper = WC_GZD_Customer_Helper::instance().

    Cheers

    • This reply was modified 3 years, 1 month ago by vendidero.
    Thread Starter John Halflord

    (@honsi)

    Hi,

    thanks for your help, the code works now.
    I actually did not experience, that the orders would not be linked to the customer account. Although i have tested it many times, however, i will keep an eye on it.

    Have a good day

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove Double OptIn for Checkout’ is closed to new replies.