Showing results for 
Search instead for 
Did you mean: 

Magento 2 redirect to custom login page


Magento 2 redirect to custom login page

I have a peculiar request to do. Since I just started backend development im rather unsure how to approach this. Requirements are the following:


1. One page checkout needs to be active

2. Guest checkout needs to be active


When clicking on the Go to checkout button on cart you are automatically redirected to one page checkout page however I need this to redirect first to a custom phtml which will have a login form and another block that will redirect to one page checkout.

Proposed solution:
1. Remove the go to checkout button on cart and add a custom button that will redirect to that page where I will output all needed. After logging in respectively or clicking on guest checkout button customer will be redirected to the checkout page. 


2. Leave the checkout button but extend or change onepage/link.phtml to redirect to the new page before redirecting to the checkout. 


Personally this sounds stupid to me but they want to have a page where returning customers can login and as well having a guest checkout. While this is not normal flow 


I really don't know what approach should I take here so any advice is welcomed. Thanking you in advance.


Re: Magento 2 redirect to custom login page

Hi @drunkenrobot,


I guess both of your ideas sounds right (but doesn't sound like the better approach as you also said).

Isn't clear why you need to allow guest checkout but at the same time you need to force the login. Isn't that a contradiction?

If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"