I cant understand Opencart event system. For example, I want to push order to external CRM, which have own API. I wrote in file /admin/controller/extension/module/mykmykpet_bitrix24.php next code:
class ControllerExtensionModuleMykmykpetBitrix24 extends Controller{
public function install(){
$this->load->model('extension/event');
$this->model_extension_event->addEvent('Bitrix24','catalog/model/checkout/order/addOrder/after','extension/module/mykmykpet_bitrix24/newOrderToCRM');
}
public function uninstall(){
$this->load->model('extension/event');
$this->model_extension_event->deleteEvent('Bitrix24');
}
}
Next, for training I wrote in /catalog/controller/extension/module/mykmykpet_bitrix24.php next code:
class ControllerExtensionModuleMykmykpetBitrix24 extends Controller{
public function newOrderToCRM($orderID){
mail("mykmykpet@mykmykpet.xyz","Hello from OpenCart Event",$orderID);
}
}
Next, I place test order and got this e-mail: E-mail content
But why I got that? I wait an order identificator, but not path to method I used. Where is my mistake? Help me, please.