Support » Plugin: WooCommerce » Editing ‘lost password’ message

  • Resolved edmundcwm

    (@disillusia)


    Question regarding “lost password” message

    I’m looking to edit the default lost password confirmation message – “A password reset email has been sent to the email address on file for your account, but may take several minutes to show up in your inbox. Please wait at least 10 minutes before attempting another reset.”

    The tricky part is to retrieve the value from the “enter your username or email” field in the “lost password” page and insert it as part of the message.

    The filter “woocommerce_lost_password_message” doesn’t include any parameters so I’m struggling to find a proper solution.

    One way I could think of is to edit the class-wc-form-handler.php file and include the user input as part of the query args. But I believe there should be a better way than to edit the core file.

    Appreciate any input!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Simply copy this file lost-password-confirmation.php into your theme in a folder called woocoommerce > templates > myaccount > lost-password-confirmation.php and then edit the message on line 27

    • This reply was modified 2 years, 5 months ago by stefsterNYC.
    Thread Starter edmundcwm

    (@disillusia)

    But the problem I’m facing is displaying the username/email, which the user has entered in the lost password page, as part of the lost password confirmation message.

    Any idea on this?

    I’m sorry I guess I don’t understand the problem. Wish I had a visual.

    Thread Starter edmundcwm

    (@disillusia)

    Sorry for the lack of clarity!

    Please take a look at the following screenshots:

    1) Lost password – https://ibb.co/hUr1jz

    2) Lost password confirmation – https://ibb.co/n61dWe

    What I’m trying to achieve is to display the email address the user entered in (1) as part of the ‘Lost password confirmation message’ in (2).

    So the final result would be something like “A password reset email has been sent to edmundcwm@gmail.com, but may take several minutes to show up in your inbox.”

    Plugin Support John Coy

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @disillusia

    As @stefsternyc mentioned, you’ll override the template then apply customizations to it to retrieve the email address used, likely using get_user_by() to retrieve the email:

    https://developer.wordpress.org/reference/functions/get_user_by/

    Hope that helps,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Editing ‘lost password’ message’ is closed to new replies.