php - How can we use opencart events? -
I have searched a lot about opencart triggers but have not found any suitable examples. OpenCert 2.0 contains such triggers on which the developer can hook up the function and estimate WordPress action and filter. For example
catalog / model / checkout / order.php
a trigger $ this-> event-> The trigger is ('Post.order.history.add', $ order_id)
Can someone help me hook up my work on the above triggers?
Important note: This answer is OC> 2.0.xx and <2.20 < / P>
The problem here is an incorrect word that is being used (and searched) - the right side you are looking for is event , and event listener and trigger event (unfortunately, there was no luck while trying to search for those people, and the documentation for 2.0 is still missing ).
Now I believe that the whole background is more understandable, especially if you have any other frameworks (maybe jQuery ?) About incidents Here's some information, but here's just a quick guide (how to work with events in OC 2.0):
-
First we have to register an event listener, such as:
$ this-> event- & gt; An event begins at some places like 'post.order.history.add', '
-
In some places, such as
< Code> $ this-> Event- & gt; Trigger ('pre.order.history.add', $ order_id);
and
$ This-> Event- & gt; Trigger ('post.order.history.add', $ order_id);
-
If the event (its Name
has been identified by post.order
(Nothing else to work with).Code> System / Engine / Event.php
Comments
Post a Comment