I need to create one observer after the customer is logged in.

I found this is the event name customer_login

My point is I installed one third-party module for some requirement. Where that extension has already created that event for their requirement.

I need to create it for some purpose in my own module.

So can I create it in my module? Is that is allowed to create the same event multiple times?


Yes you can create multiple observer for same event

Its broadcast and listener kind of relationship

where the dispatch code is broadcaster and the all observers are listeners

even you can observe same event multiple times in your single module

  • So, once we create multiple observer for same event, all the code written in each observer will be fired is it? – jafar pinjar Aug 31 '18 at 12:27
  • @jafarpinjar exactly – Murtuza Zabuawala Aug 31 '18 at 12:27
  • @jafarpinjar the only thing is the order of observer called depends on which module load first – Murtuza Zabuawala Aug 31 '18 at 12:29
  • 1
    That's great @murtuza, Its helped me. Thank you – jafar pinjar Aug 31 '18 at 12:29
  • @jafarpinjar you are always welcome :) – Murtuza Zabuawala Aug 31 '18 at 12:29

Yes you can use an event multiple time, but main problem is it's observer firing order and it's controls.

My suggestion is create a separate module with dependency of current third party module, which is currently using same event and dispatch a you own event.

  • Hi what do you mean about "module with dependency" ? how can you achive that, thanks – open-ecommerce.org Aug 27 '20 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.