Redirect Login User to Previous Page (New customer accounts)

Shopify Partner
25 3 11

Is there a way to redirect users when they log in to the previous page they were on before they landed on the log in page?



We are using the New customer accounts:




Replies 6 (6)

Shopify Partner
21 5 4

1. Online Store > Themes.
2. Actions > Edit code.
3. In the Templates directory, click customers/login.liquid or the file that contains the login code.
4. Search for this line "{% form 'customer_login' %} "
5. Below it, Paste this :

 <input type="hidden" name="checkout_url" value="/collections/all">  

Replace the value in the above line with the page you want to display after login.


Shopify Partner
25 3 11


There is no `login.liquid` or anything close to that.  

This is not a theme thing.


The url when one clicks "account" goes to "/account" and then redirects to this:

I am thinking I can try to hard-code the "account" url in the Header and adding the parameter `redirect_uri`.

15 1 15

I'm looking for this solution as well and cannot find the template mentioned in the theme either.  I'm trying to find the right form in main-login.liquid, but am not sure if I'm looking at the right page and if the new vs. old account are even in the same place.


Did you end up finding a solution and if so, would you be willing to share it with this thread?

Thanks for any help!

1 0 4

Just bumping this, I am also look for a solution where I can control the redirect on the New Account -> Login screen. 

We use YOTPO Loyalty and this New Account experience is extremely disruptive and confusing for customers since we can't include any of our Reward information or language on the New Account page. 

Shopify Partner
9 1 3

Any solution for this please?


Shopify Partner
8 1 4

I had confirmed by Shopify Support that redirecting back to the original page with NEW customer accounts is *not* supported. They duggested reverting back to classic.