Answer the question
In order to leave comments, you need to log in
How to transfer the event system from OpenCart 3.0 to 2.3.0.2?
Hello everyone
In the extension ported from opencart 3.0 to 2.3, this piece of code does not work:
public function install()
{
if (!$this->model_setting_event->getEventByCode('travesty_admin_column_left')) {
$code = "travesty_admin_column_left";
$trigger = "admin/view/common/column_left/before";
$action = "extension/module/travesty/menu";
$this->model_setting_event->addEvent($code, $trigger, $action);
$code = "travesty_footer";
$trigger = "catalog/view/common/footer/before";
$action = "extension/module/travesty/footer";
$this->model_setting_event->addEvent($code, $trigger, $action);
$code = "travesty_header";
$trigger = "catalog/view/common/header/before";
$action = "extension/module/travesty/header";
$this->model_setting_event->addEvent($code, $trigger, $action);
}
}
public function uninstall()
{
$this->model_setting_event->deleteEventByCode('travesty_admin_column_left');
$this->model_setting_event->deleteEventByCode('travesty_footer');
$this->model_setting_event->deleteEventByCode('travesty_header');
}
Answer the question
In order to leave comments, you need to log in
it's smarter to upgrade 2.3 to 3, less problems, more value for the future
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question