Shopify themes, liquid, logos, and UX
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:
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.
@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`.
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!
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.
Any solution for this please?
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.
Is it still the case?
Yes unfortunately I confirmed this a few days ago with support.
I reverted to using old accounts because of this - that's the only solution/workaround at the moment.
Yeah makes sense. We're using classic on our retail site, but our wholesale site uses Shopify's b2b features which unfortunately require new customer accounts. Kinda stuck in a bad spot here at the moment. Please help Shopify
Same boat here, need the b2b features but want to redirect to the front page after logging in.
Shopify please do something...
I have created this solution for New Customer Accounts
Basically I am getting Last URL of non-login customers in browser session storage, and when they login with new Customer Account, after login the users initially redirected to Order Status Page, but from there when they click on Store the Home Page opens with accountnumber query Parameter,
so based on that I have created a following logic, and it redirect customers back to the paqe where they get to the login page
{% unless customer %}
<script>
sessionStorage.setItem("last_url_visited", "{{ canonical_url }}");
if( sessionStorage.getItem("new_account_login") != null ){
sessionStorage.removeItem("new_account_login");
}
</script>
{% endunless %}
<script>
const searchParams = new URLSearchParams(window.location.search);
const cxAccNum = Number(searchParams.get('accountnumber'))
if(cxAccNum >= 1 ){
if( sessionStorage.getItem("new_account_login") == null ){
sessionStorage.setItem("new_account_login", "1");
window.location = sessionStorage.getItem("last_url_visited")
}
}
</script>
,
Hey Shahidameen!
As far as I can understand, with your code the user is still directed to the account page after login, but then when going to the store he/she is redirected to the original page the came from before logging in - right?
My problem is I want the user to go straight to the front page of the store after login, so they don't ever see the account page unless they actively choose to go there. I don't think it is possible to add your script to the account page, which would be a way to solve this issue.
Try this and in retrun_to add your encoded return path
I am not sure what you mean, where should I create and use this URL?
you can replace the login URL with this (/customer_identity/login?return_to=) URL it will return the user after login to the given path
Where can you modify the login URL when using the new Customer Accounts?
Hello @frede-1994
Now with Shopify Recent Release, you can just do that (Can be redirected back to the Previous Page from where login was originated) or to any custom page using
storefront_login_url route in the routes object.
Here is Change Log.
https://changelog.shopify.com/posts/direct-customers-back-to-the-online-store-after-login
With Recent Shopify Release, you can just do that, either redirect them to Previous Page where login was originated and even to the Custom Page.
Here is the Change Log
https://changelog.shopify.com/posts/direct-customers-back-to-the-online-store-after-login
Credits: @Taylor Page
Thanks a lot 🙂
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024