Page 1 of 1

2.3 Events. Where events registered?

Posted: Tue Jan 17, 2017 6:48 pm
by chulcha
2.1
index.php

Code: Select all

$query = $db->query("SELECT * FROM " . DB_PREFIX . "event");

foreach ($query->rows as $result) {
	$event->register($result['trigger'], $result['action']);
}
2.3
system/framework.php

Code: Select all

// Event Register
if ($config->has('action_event')) {
	foreach ($config->get('action_event') as $key => $value) {
		$event->register($key, new Action($value));
	}
}
Only those events that are described in config

Where or When to register events that are added through

Code: Select all

$this->model_extension_event->addEvent('my_theme', 'catalog/controller/catalog/product/before', 'my_theme/product');
https://github.com/opencart/opencart/wi ... s)-2.2.x.x

Re: 2.3 Events. Where events registered?

Posted: Wed Jan 18, 2017 4:29 am
by JNeuhoff
The only 2 places I can think of are:

1) In the install.php, which is part of an .ocmod.zip extension installed via OpenCart's extension installer.

2) Or you could create a dummy module, e.g.

admin/controller/extension/module/mytheme.php

which has an install method.