Hello everyone,
I would like to know if it's possible to know an updated_at datetime when we add / remove a category on a product? We have a problem on products that they look moving category without humans actions.. The product are moving categories and adding special prices. that's realy strange and i would like to get information when the product are moving and updated special price.
Currently i'm trying to get the information by sql. But i'm unable to get the updated_at on the relation category/product or updated special price date.
Any idea how to know that?
Thanks.
Solved! Go to Solution.
Hi @stebaribeau
Create observer for save events as listed below:
For category save:
event: catalog_category_prepare_save
For save product:
event: catalog_product_save_after
Using observer you can get update after save category or product.
Problem Solved? Please click on 'Kudos' & Accept as Solution!
Hello @stebaribeau
We have to events in Magento default which you can use using observer by create events.xml in your custom module.
Event name: _move_before
File: vendor/magento/module-catalog/Model/Category.php
$this->_eventManager->dispatch($this->_eventPrefix . '_move_before', $eventParams);
Event name: _move_after
File: vendor/magento/module-catalog/Model/Category.php
$this->_eventManager->dispatch($this->_eventPrefix . '_move_after', $eventParams);
If this helps, Click on Kudos and Accept as Solution.
Thank you
Hiren Patel
Hi @stebaribeau
Create observer for save events as listed below:
For category save:
event: catalog_category_prepare_save
For save product:
event: catalog_product_save_after
Using observer you can get update after save category or product.
Problem Solved? Please click on 'Kudos' & Accept as Solution!
thanks your soluce are good too.,. i can't only choose one!
thanks both of you for your answer.