Opencart Event System
Opencart Event System allows you to write the code which will execute when something like inserting, deleting and updating happens in Opencart. Like when any customer place an order or admin add any product. If you are using Opencart Event System, you do not need to use vQmod or OCMOD for adding a large amount of code.
Firstly you have to add Event Handler to your module. Here we add two events to customer add for catalog side and on product edit for admin side. Before using Event System you have to load event model file, then call to addEvent() function like mentioned below.
After adding an event, you can also delete the registered event by using the deleteEvent() function.
Now you can implement the registered event handler like:
You can track each product and can manage your module record with this registered handler on each product edit.
At last, you have to trigger this registered event into product edit code. For trigger event, you have to use trigger() function of the event model.