0

Magento 2 which event used for after order success and product saved in backend. I have created catalog_product_save_after event once saved product inserted data to my custom table. But the problem is once an order is placed from frontend this event is not triggered.so I need the event for after order success product save the event

1
  • you have to use this event checkout_onepage_controller_success_action and after that, you have to load the ordered item and get the product id from that and update it to the related product table and custom table. Hope this one helps you.
    – viru
    Oct 13 at 5:32
1

You need to use below events

checkout_submit_all_after

catalog_product_save_after

After order place sucess - use this "checkout_submit_all_after" in

app/code/Your/Module/etc/frontend/events.xml

After product save after - use this "catalog_product_save_after" in

app/code/Your/Module/etc/adminhtml/events.xml

you can use both event on global level too. use both events on below path

app/code/Your/Module/etc/events.xml

1

You need to use this event order order success.

checkout_submit_all_after

2
  • where i have add events.xml for this event etc/frontend/events.xml or etc/adminhtml/events.xml already added this event under etc/frontend/events.xml not working
    – kanidhaya
    Oct 13 at 5:36
  • you need to put into the "etc" Oct 13 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.