Situation is:
Admin logs in to system and he changes product somehow.
For example:
Sets qty to 10 Adds 2 images Changes description
Is there any way to track these changes? Well I mean exactly track WHAT and HOW admin changed?
I use Magento CE 1.6
Yes you can find unaltered data through getOrigData() as pointed out by clockworkgeek but Magento has a build in function to compare and check if the data has been changed. The method is called dataHasChangedFor() and you have to pass the property that you want to check. It would look somthing like this.
$isChanged = $productData->dataHasChangedFor('description');
if ($isChanged) {
// do somthing
}
here the method dataHasChanged() will return boolean value based on whether the data was altered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With