Lost password Endpoint & shortcode in woocommerce not working

Good evening everyone.
I have a serious problem. In login page template the ‘The Lost password’ don’t work.

More specific :

Read More
  • Enable registration on the “Checkout” page
  • Enable registration on the “My Account” page
  • “My Account End points” : Lost Password as same : “lost-password”
  • [woocommerce_lost_password] in page template of lost password

This is my custom page template

I override the form-login.php in my custom page template templates-form-login.php

The default code for “forgot the password” is :

<p class="lost_password"> 
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"> 
<?php _e( 'Lost your password?', 'woocommerce' ); ?>
  </a> 
</p>

but not appear.

So i add the code from : mytheme/woocommerce/emails/customer-reset-password.php and replace with the default code :

<a href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'login' ) ) ) ); ?>">
<?php _e( 'Click here to reset your password', 'woocommerce' ); ?>
</a>

Then redirect me in the same page and not in lost password page. The url is :
localhost/mytheme/login/lost-password/?login

The same result i have if i add the “login” page as parent to “lost password” page inside the page section.

If i replace the wc_get_page_permalink( 'login' ) with the `wc_get_page_permalink( ‘shop’ ) then redirect me in shop.

Thoughts?

Related posts