By default WooCommerce has only one page showing both login and registration boxes but in a few easy tweaks you can have separate pages for login and registration forms.
Simply create a copy of the WooCommerce form-login.php located in /woocommerce/templates/myaccount/ folder and name it form-register.php.
Now next step is to create a link in form-login.php to the form-register.php, use this code:
<a href=”‘ .get_permalink(woocommerce_get_page_id(‘myaccount’)). ‘?action=register”> register </a>
Last step is to modify your themes function.php file by adding this code:
add_action(‘woocommerce_before_customer_login_form’ , ‘load_registration_form’, 2);
function load_registration_form(){if(isset($_GET[‘action’])==’register’){woocommerce_get_template( ‘myaccount/form-registration.php’ );}}
That’s all with hacking.
Alternatively, you can also make use of Woocommerce Login / Signup Lite to create a sign up and login process for your ecommerce site with the use of shortcodes.
- For login form use – [lsphe-login-form]
- For signup form use – [lsphe-signup-form]
- For both login and register form use – [lsphe-header]
For headers and templates use this code –
<?php echo do_shortcode(‘[lsphe-header]’ ); ?>
This plugin allows you to create:
- A Sign Up and Login Pages
- A Sign Up and Login Popup
- A Page Header that gives you access to both these pages or popups.
This did not work for me. I get a 404 error. Any idea why?
Then make use of WooCommerce Login/Signup Lite plugin – https://wordpress.org/plugins/woocommerce-login-and-registration/