0

I want to trigger when a product image is changed in admin to get the image URL and call my external API to sync the product image from Magento to my operation.

But I don't know how to trigger this. I found an event when the product save button is clicked "product_save_after". But if I use this, even not change the image, it will call my API.

Can you give me some advice!

Thank you very much!

1
  • Hi, this can't be simply done using an event observer. This needs a customized code based on Jquery that function when image is changed in backend. Mar 18, 2022 at 11:17

1 Answer 1

0

A useful Magento Event : catalog_product_gallery_upload_image_after This Event Triggers when we upload the Image in Catalogue Product in Admin You can use this observer to do some extra work, or call any API or any other Stuff.

I have answered on the Magento Community forum, Check the detailed answer in the Given Link :

https://community.magento.com/t5/Magento-2-x-Programming/Trigger-an-API-Call-on-uploading-Images-Magento2/m-p/477530#M13046

enter image description here

2
  • this is a really useful observer! Just a question: using this observer, is there a way to access to the data of the product that has been saved ? If I call the event data I can only see the image information
    – Lou Nik
    Nov 23, 2022 at 12:54
  • Only Image data will Be there @LouNik, For Product change data you have to use another observer Nov 25, 2022 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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