I'm using opencart version 2.1.0.1 and trying to use the new script notification system. Please note that I have simply installed the original version. Nothing extra added or modified.
Following the tutorial found here: http://isenselabs.com/posts/opencart2-event-system-tutorial I managed to create a new module and install it successfully. I can confirm from the database that it has registered the events that I want to trigger.
To give you a better picture I have created these files:
- admin/controller/module/testo.php
- admin/view/template/module.testo.tpl
- admin/language/english/module/testo.php
- catalog/controller/module/testo.php
Now although the admin events are triggered with no problem the Catalog (fronted) Order Events never fire.
On admin/controller/module/testo.php function install I have the following call:
$this->model_extension_event->addEvent('testo', 'post.order.add', 'module/testo/on_order_add');
And according to the tutorial the function to fire should be in catalog/controller/model/testo.php
public function on_order_add($order_id) { .... }
The function simply writes the order_id to a text file, nothing tricky there.
So when I complete an order the function never runs. I have tried most Order Notification Hooks with no luck.
Am I missing something? Is there something I'm not understanding? Please help since there is absolutely no documentation and I'm on a dead end (for the time)