How to redirect customers when they login to another page instead to their account

I want to create page with some disocunts for example and only those who have account to see that page. I want when someone sign up or login to their account instead to be redirected to other page instantly, something like a vip lounge

The theme I need this is debut

Hi,

You have to pass following one line in your form on login and register page.

  1. Go to Online Store->Theme->Edit code
  2. Template->customers/login.liquid and customers/register.liquid->find form and place this line in form.
<input type="hidden" name="return_to" value="/cart">

Note: Change value=“/cart” to your page where you want to redirect after login or register.

Let me know if you need help.

thank you, I would also like the account icon in the right upper section also to redirects to the page when I click on it, and also to put a name next left of the icon, the name of the page to be here

Send me your store url and password(if protected) here or on mail or Skype.

can you just tell me the code, I want to learn myself to do it

You can do it with html and css code for that no need to do anything.

can you tell me what code to put so I can make a page in the header to be connected with the customer login, or just to add name next to the account icon so to look like it is a tab of that page

Hi,

Can I use the same code for venture theme?

I want customers to see the homepage after they login.

Appreciate your response.

Many Thanks

I’d like to know also

You have to follow this step:

  1. Go to Online Store->Theme->Edit code
  2. Template->customers/login.liquid and customers/register.liquid->find form and place this line in form.
<input type="hidden" name="return_to" value="/cart">

Note: Change value=“/cart” to your page where you want to redirect after login or register.

Where do I paste it ? @Jasoliya

Just paste above “{% endform %}” line.

Do you mean above all the “{% endform %}” lines or just one?

Many Thanks

in login of register page may be its just one form, so you should have to add this line withing {% form … %} to {% endform%}

Hi @Jasoliya - do you know how to implement your solution for whatever the previous/referring page was (instead of one specific URL)? For instance, we have password-protected collection pages that require login that we’d like to automatically redirect the user back to after they log in. Appreciate your help!

For collection page need to do some js code to manage it, it must work on login page form

or you can try to send user to login page with return url may be work

Hi @Jasoliya - thanks for the response! When a user tries to access our password-protected collection page, we include some verbiage telling them to click a link to log in to their account (which takes them to a new page). So, your solution of a return URL would be ideal. Is there a simple way to implement that (similar to the solution you previously provided using

<input type="hidden" name="return_to" value="/cart">

Hi send me your store url will try to check

Thanks @Jasoliya ! Our store url is https://raevino.com/, but our current flow that we’re trying to solve for is as follows:

  1. Wholesaler visits dedicated collection page (Ex - https://raevino.com/collections/walden-selections))

  2. Wholesaler is asked to log in (see hyperlinked text on aforementioned page)

  3. Upon logging in, Shopify defaults wholesaler to their account page, but we want them to be redirected back to the original collection URL (https://raevino.com/collections/walden-selections)

We have several different wholesalers, so we can’t have a static URL in our customers/register.liquid or customers/login.liquid code. Instead, we need a dynamic return URL.

Appreciate your help!

For that you have to do some customization

like you have to pass query string in login link and then when user go to loging page you have to check this query string and pass return_to field in login for so it will back to that page

you can use this type of link on collection page

https://raevino.com/account/login?return_to=walden-selections