I would like to monitor which dashboard user ("admin") added new product to the database.
The solution i was thinking about is simply adding another insert
under admin > model > catalog > product.tpl
under function addProduct()
, which adds the user id to the custom column added before under oc_product
.
$userID = // currently logged in
public function addProduct($data) {
$this->event->trigger('pre.admin.product.add', $data);
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET addedby = $userID, .......");
.......
}
The only problem I have now is how to call / get the currently logged admin id inside this file (model/catalog/product.tpl).
This is just how i think about it, if this idea is completely wrong, please do write some better solutions.