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.
Solved! Go to Solution.
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..
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.
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
same for predispatch
Appreciate your reply. it helped me to understand the predispatch and postdispatch.