cancel
Showing results for 
Search instead for 
Did you mean: 

Observer event to check customer login on checkout page

SOLVED

Observer event to check customer login on checkout page

I  have created observer that will be fired after customer will login and update the price of the added to cart.

 

Now thing is when i try to login on checkout page it doesn't fire.  it works for default login page. but on checkout page it doesn't work.  

 

I have used following event to fire my observer code:

 

 <event name="customer_login">
        <observer name="customer_login_observer" instance="Customergroup\Updategroup\Observer\CustomerLogin" />
    </event>

this event is not working when i login on chekout page.

 

How can i check if customer is logged in then update the cart item on checkout page?

 

Any help would be appreciated.

5 REPLIES

Re: Observer event to check customer login on checkout page

You can use below event for checkout customer login page,

 

<event name="controller_action_postdispatch_customer_ajax_login">

If Issue Solved, Click Kudos/Accept As solutions.
Tags (3)

Re: Observer event to check customer login on checkout page

Thanks Rakesh bhai.  How did you check that event?  I mean how did you get to know that event is use by that?    I am new to m2 so that would help me..

 

 

Re: Observer event to check customer login on checkout page

When you check in checkout page email login, after valid email and password on checkout press on login button they will call one request customer/ajax/login. so based on that request we can set pre or post dispatch request for any magento event.

If Issue Solved, Click Kudos/Accept As solutions.

Re: Observer event to check customer login on checkout page

Hello,

 

<event name="controller_action_postdispatch_customer_ajax_login">

 

you can make any controller  postdispatch and predispatch of any event .

e.g your controller name is test_test_index

 

you can make event like

<event name="controller_action_postdispatch_test_test_index">

same for predispatch

 

<event name="controller_action_predispatch_customer_ajax_login">

Re: Observer event to check customer login on checkout page

Appreciate your reply.  it helped me to understand the predispatch and postdispatch.