Login/Registration form on custom page redirects to default customers/* page with form error

New Member
4 0 0

I have embedded the login and register forms into a product page in order that the user is forced to signup/login before they purchase my membership product (which tags their account, thus necessitating them needing to be logged in)


I have successfully tested this for the cases when you fill in the forms correctly or login successfully. Using the following snip-its for the registration 

<input type="hidden" name="return_to" value="{{ canonical_url }}" />

 and login forms

<input type="hidden" name="checkout_url" value="{{ canonical_url }}" />

When the customer logs in or registers they will stay on the same product page where they registered or logged in. 


The problem

If, while filling out the registration or logging in, you make a mistake (wrong password, missing fields) you are sent to the customers/register or customers/login page where the error is displayed.


This is not the behavior I am looking for. I would like the errors to be displayed in the same embedded form area where they initially entered the wrong data. How can I make this work?

New Member
1 0 0

Hi @SerajD Did you find a solution to this?


Shopify Expert
2486 416 523

Hi @SerajD 

For that you need to use ajax function.

you can call login page by sending details in ajax and you get whole login page as response in order to success or error.

so you have to find error div in html and show error on popup.

But in this case if captcha generate then you must go to login page it cant work with popup.

May be it help.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
New Member
4 0 0

Thanks for the info.