cancel
Showing results for 
Search instead for 
Did you mean: 

call event when product attribute is update - Magento 2

call event when product attribute is update - Magento 2

How can i call event when product attribute are change. i try following thread but not success.

http://magento.stackexchange.com/questions/94018/listen-for-event-after-attributes-are-saved-magento...

1 REPLY 1

Re: call event when product attribute is update - Magento 2

Hey khamarpratik,

 

The code which you provided by the  link looks good. Maybe you need to check a few steps:

  •  Xml file needs to be placed by the path:
app/code/[Namespace]/[Module]/etc/di.xml
  • When you place new xml files, you need to flush cache
  • When you place new model, you need to run the compilation via console:
php bin/magento setup:di:compile
  •  Also if you create new module, you need to install it:
php bin/magento setup:upgrade
  •  And finally, check your code in the aroundUpdateAttributes method. Your code needs to be placed instead of this comment: "//do something with $productIds here".

Regards,
Plumrocket Team