Back to Top

Opencart Event System

Updated 31 October 2017

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.

Screenshot_1

 

After adding an event, you can also delete the registered event by using the deleteEvent() function.

Searching for an experienced
Opencart Company ?
Find out More

Screenshot_2

Now you can implement the registered event handler like:

Screenshot_3

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.

Screenshot_4

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • Evan Langlois
    • vivek sharma (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home