• Resolved zbyneksmetana

    (@zbyneksmetana)


    Hook woocommerce_registration_error_email_exists works on WooCommerce version 9.3.3 but does not work in newer versions. Has anyone encountered this issue?

    add_filter( ‘woocommerce_registration_error_email_exists’, function() {
    return ‘some text’;
    } );

Viewing 6 replies - 1 through 6 (of 6 total)
  • add_filter( 'woocommerce_registration_error_email_exists', 'wp_kama_woocommerce_registration_error_email_exists_filter', 10, 2 );

    /**
    * Function for
    woocommerce_registration_error_email_exists filter-hook.
    *
    * @param $__
    * @param $email
    *
    * @return
    */
    function wp_kama_woocommerce_registration_error_email_exists_filter( $__, $email ){

    // filter...
    return $__;
    }

    Please check above example and parameter.

    Plugin Support Jonayed Hosen (woo-hc)

    (@jonayedhosen)

    Hi @zbyneksmetana ,

    Thank you for reaching out! With recent updates, WooCommerce has deprecated the woocommerce_registration_error_email_exists filter. This means that this specific filter is no longer supported or active in the latest versions of WooCommerce. If your site relied on this filter for custom functionality, any related custom code will no longer work as intended.

    To address this, WooCommerce now uses the woocommerce_registration_errors filter, which provides greater flexibility. This filter allows you to intercept and modify registration errors before they’re displayed to users. For example, you can customize the error message that appears when a user tries to register with an email address that’s already in use.

    Here’s a helpful guide with an example of how to implement the woocommerce_registration_errors filter:
    https://www.wp-kama.com/plugin/woocommerce/hook/woocommerce_registration_errors

    I hope this helps.

    Thread Starter zbyneksmetana

    (@zbyneksmetana)

    Thanks for the info, it calmed me down. I thought there were some plugin conflicts.

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @zbyneksmetana,

    Glad to hear the info was able to calm you down – thanks for letting us know!

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

    Thread Starter zbyneksmetana

    (@zbyneksmetana)

    I have a problem on the ‘my-account’ page where I have a registration form. I wanted to use the woocommerce_registration_errors filter to change the ’email already exists’ message, but I noticed something strange. Specifically, the filter in the code below is not being triggered (the ‘test’ message does not appear in the debug.log) when entering an existing email in the registration form. Does anyone understand this? Debugging works fine because I tested with a non-existent email and then the ‘test’ message appears in the logs.


    add_filter(‘woocommerce_registration_errors’, ‘custom_registration_error_message’, 10, 3);

    function custom_registration_error_message($errors, $username, $email) {
    error_log(“test”);
    return $errors;
    }

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I can understand you are facing issue while using the following filter “woocommerce_registration_errors” please note that we do not provide support for customization. If you need more in-depth support or want to consider professional assistance for customization, I can recommend?WooExperts?and?Codeable.io?as options for getting professional help. Alternatively, you can also ask your development questions in the??WooCommerce Community Slack?as custom code falls outside our usual?scope of support.

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.