Search code examples
magentoobservers

Need advice about Magento events


I created a module with a function inside Observer.php of said module. I want to run this script everytime there is a change inside the database regarding products but I can't find the right event to attach my observer, any tips?


Solution

  • Really depends what changes you are looking for, but this one will catch most fundamental product changes;

    catalog_product_save_before
    

    or

    catalog_product_save_after
    

    Depending on what it is you need to achieve.

    These cheat sheets from Nick Jones are well worth a look https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/