Z
Z
zeaovede2022-03-31 18:15:30
WordPress
zeaovede, 2022-03-31 18:15:30

How can I change the error message on the .../checkout/ page?

Error: "An account with this email address is already registered. Sign in."
How can I change this error on the .../checkout/ page?
I thought the solution below would work but it doesn't

function my_woocommerce_add_error( $error ) {
    return str_replace('An account is already registered with your email address. Please log in','sdfhasd il address. Please log in.',$error);    
}
add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zeaovede, 2022-04-01
@zeaovede

It took a long time to search. Is it useful to someone

/** Replace 'An account is already registered with your email address. Please log in.' **/
add_filter( 'woocommerce_registration_error_email_exists', function() {
    return 'Este înregistrat deja un cont cu adresa ta de e-mail. <a href="#" class="showlogin">Te rugăm să te autentifici.</a>';
} );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question