tri1976 wrote: ↑Thu Nov 09, 2017 3:26 am
Opencart 3.0
I would like to run a function that uses the customer_id after the customer is logged in. Here is my setup
Code: Select all
event: 'my_event', 'catalog/controller/account/login/after', 'extension/module/my_event/updateCustomer'
function updateCustomer($route = '', $args = array(), $output = '') {
}
After the customer logged in, I see $route output "account/login" but nothing for $args, $output, or $this->customer->getId(). Am I doing something wrong? How do I get customer_id after the customer login event?
Thanks.
I've faced the same problem right now and I've found and using this function that is *always used after a login
catalog/model/account/customer/deleteLoginAttempts
// events after login
$this->model_setting_event->addEvent('my_event', 'catalog/model/account/customer/deleteLoginAttempts/after', 'extension/module/accountautodisabler/updateCustomer');
----
For events before the login there are different functions to check
catalog/controller/account/login/before
catalog/controller/checkout/login/save/before
catalog/controller/api/login/before
...
----
The events should work for OC 2.3.0.2 up to 3.0.3.8
I hope that those informations can be useful