How to redirect Shopify customer to specific page after login / logout / register

1. Redirect customer on new account creation

By default, the new customers are directed to the account page after register new account. Kindly follow the below steps to redirect the customer to a specific page when they register new account:

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • In the Templates directory, click customers/register.liquid.
  • Find the following line of code:

    On a new line below it, paste the following:

  • For the value attribute in the line of code that you just pasted, replace /collections/all with the relative URL of the page that you want customers to see when they register new account.
  • Click Save

2. Redirect customer on login

When a customer visits your online store and logs in to their account, they will see a My Account page that shows their past orders and associated shipping and billing addresses. You can edit your theme so that customers are taken to a different page when they log in.

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • In the Templates directory, click customers/login.liquid.
  • Find the following line of code:

    On a new line below it, paste the following:

  • For the value attribute in the line of code that you just pasted, replace /collections/all with the relative URL of the page that you want customers to see when they log in.
  • Click Save

3. Redirect customer on logout

By default, Shopify redirects the customers to home page after logout. If you want to redirect the customer to show a specific page, there is no built in way to do it. Here is a small script to achieve the same.

This script will work for all the logout links that you may have on the page.

You may also like...

5 Responses

  1. PSD to shopify says:

    Wow really interesting article, Thanks for sharing this.

  2. Michael says:

    This is helpful if you want to redirect all users to the same page. If you want more dynamic redirect options, I would recommend the Customer Fields app.

    You can conditionally redirect customers (after account creation) based on their form they fill out, or even based on their input. Here’s an article on conditional form redirects (http://help.heliumdev.com/en/articles/3541525-redirect-customers-after-form-submission)

    You can even redirect to checkout and automatically add certain products to the customer’s cart (http://help.heliumdev.com/en/articles/3664703-how-to-use-form-redirects-for-order-conversion)

  3. VladimirC says:

    1. is no longer an option
    2. I’m pretty sure is not working as well

  4. Meganathan says:

    @VladimirC , yes its not working.(Registration redirection).

    Do you have any idea about redirect to specifiy page after registration

  5. Kate says:

    Hi. This post was very helpful. Thank you. I was wondering if you know a way to bring up a different page upon login based on a customer tag. I need some customers to see the accounts page (default) and some to see the new login page.

Leave a Reply

Your email address will not be published. Required fields are marked *