In controllers/front I created a controller named abandonedCarts:
class <moduleName>AbandonedCartsModuleFrontController extends ModuleFrontController
{
public function __construct()
{
parent::__construct();
$this->context = Context::getContext();
$this->store_debug('Controller - __construct');
}
public function initContent()
{
parent::initContent();
$this->store_debug('Controller - init');
}
}
where store_debug is a function that simply logs on the db something (just for check). Thanks to this I know that when I call the controller from URL in this way
site/index.php?fc=module&module=olyo&controller=abandonedCarts
the construct and init methods are being called, but what I need is the controller being called when the module is installed (or at its first start).
In the main file I also put in the constructor this line:
$this->controllers = array('abandonedCarts');
But I'm not sure I even need it