Print This page

LoginPress WooCommerce Compatibility

To get rid of the default and boring login form for your eCommerce website customers, you can use your designed awesome login page with LoginPress.

Here is the scenario for the above situation:

  • Customer visits My Account page, he will be redirected to your designed login page.
  • After logging in the customer will be redirected back to its My Account page and see its information as usual.

Here is what you need to do:

 1. First, add the following snippet in your child theme’s file functions.php and update your file. 

This piece of code will make sure if the user is not logged in and visits its My Account, then it will go directly to your designed login page.

function loginpress_woo_login() {
if ( function_exists( 'is_account_page' ) ) {
if ( ! is_user_logged_in() && is_account_page() ) {
add_action( 'wp', 'loginpress_woo_login' );

 2. Now you need to set up redirects for customers so they can redirect to their accounts page on login.

Here is where our “LoginPress Login Redirects” addon will come to action.

 1. Install and active Login Redirects addon.

 2. Navigate to Login Redirects setting page.

 3. Choose the Specific Roles tab.

 4. Search your customer’s role i.e. “Customer

 5. Now add your “My Accounts” page URL in Login URL filed e.g

 6. Then add your desired logout page URL for customers in the Logout URL field, this can be your site default landing page e.g, or just simply “/”

This is it, all done. 

Easy right! Now you can show off your awesome login page to your customers.