Redirect Login User to Previous Page (New customer accounts)

stats_marketing
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?

stats_marketing_1-1683831035288.png

 

We are using the New customer accounts:

 

stats_marketing_0-1683830975570.png

 

Replies 6 (6)

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

 

stats_marketing
Shopify Partner
25 3 11

@Bhaskar_Sonowal 

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:
`https://customer.login.shopify.com/lookup?destination_uuid=1234&redirect_uri=https%3A%2F%2Fshopify.c...`

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


linia
Excursionist
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!

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

matoow
Shopify Partner
9 1 3

Any solution for this please?

 

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