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...

Leave a Reply

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