Redirect Login User to Previous Page (New customer accounts)

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

stats_marketing_1-1683831035288.png

 

We are using the New customer accounts:

 

stats_marketing_0-1683830975570.png

 

Replies 3 (3)
Bhaskar_Sonowal
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.

 

stats_marketing
Shopify Partner
22 3 9

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


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