opencart/opencart — pull request #1631 by raxbg (2014-07-13 11:53:43+00:00)
Title: Event system for the modules

Hi,
I have created a simple event system for the modules to use. The reason for proposing this is because that way the OpenCart system will stay more stable when a lot of extensions, which have vQmod/modification files, are installed. A modification system like vQmod or the new modification system of OpenCart is very powerful, but tends to create bugs when some module replaces a piece of code to which another module needs to hook. This makes the second module misbehave and creates a bad experience for the customers.

By using events, the modules will be able to register event handlers and will not need to modify core files in order to run some custom logic when a new customer is registered for example.

I have added a single demo event for now, which is triggered when a new customer is registered. I have also created a very basic module that makes use of this event, just to demonstrate the system in action. The module is called "Event Demo" and gives 10 reward points to the customer after he/she registers.

If you approve the event mechanism, I will be happy to add more events throughout the system.

If you have any questions about how the event system works I'd be glad to answer.