Separate registration page in WooCommerce website

前端 未结 3 1982
青春惊慌失措
青春惊慌失措 2020-12-06 21:56

Can anybody help me build a separate registration page in WooCommerce instead of displaying it in the my-account page?

In the my-account p

3条回答
  •  醉话见心
    2020-12-06 22:10

    I finally figured out the code to have separate registration and login pages via individual links in the header.

    You will need to edit 2 files in your child theme:

    1. functions.php and
    2. form-login.php

    I have attached txt files for the code

    1) functions.php: You want to create a register link in the header that links to the login page but also sets an action indicating you have clicked register. So this:

    $aux_links_output .= ''. __("Login", "swiftframework") .''. "\n";
    

    becomes this:

    $aux_links_output .= ''. __("Login", "swiftframework") .''. "\n";
    $aux_links_output .= ''. __("Register", "swiftframework") .''. "\n";
    

    2) form-login.php code: Here you want to create an if,else statement. If you clicked register then goto register page, else goto login page:

    
    

    Section for registration

    
    

    Section for Login form

    
    

    Be careful of the wrappings

    Thanks

提交回复
热议问题