Redirect Login User to Previous Page (New customer accounts)

Shopify Partner
22 3 9

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 3 (3)
Shopify Partner
15 4 3

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
22 3 9


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

1 0 1

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.