0

I have working extension of 3.0 Opencart and i need convert it to 2.3.0.2. Right now, i can't fix install/uninstall method at admin/controller

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');
    }

According to documentation, events available from 2.2 version of OpenCart, so, what shoud i chancge to make it work?

Sergey Bakotin
  • 373
  • 1
  • 3
  • 15
  • Well, the immediate problem is that model/setting/event.php does not exist in 2.3.0.2. It's been changed several times from 2.2 to the current version. Perhaps this thread may shed some further light: https://stackoverflow.com/questions/26428914/how-can-we-use-opencart-events (and look at both answers there as they pertain to different versions) – Nancy Jan 12 '19 at 03:19
  • @NancySavescu according to documentation https://github.com/opencart/opencart/wiki/Events-System i just need rename deleteEventByCode method andd and add $this->load->model('setting/event'); but it doesn't work either. Any idea? – Sergey Bakotin Jan 12 '19 at 11:15

0 Answers0