I would like to observe the event when the exchange rates are fetched from Webservicex. Is there such an event that I can observe? I haven't been able to find one in the docs and am not too happy with setting a up a cron.

  • What do you need to do with it? There is not one on the fetch but you can hook into the save. Feb 18 '15 at 13:39

From what I'm seeing in Mage_Directory_Model_Currency_Import_Abstract and Mage_Directory_Model_Currency_Import_Webservicex and the whole Mage_Directory module, there is no dispatchEvent() method included. You could just hook on events from basic save/update methods then.

You did not mention what you're trying to achieve but as a general advice, best practise in this case would be to extend the class on your own, put your own events in and observe them.

  • 1
    I have an extension that notifies a third-party site about changes in the exchange rate, by calling an API. I guess observing the directory_currency_save_after event of the currency model will easily suffice for the need. Feb 18 '15 at 14:03
  • It looks like the WebServiceX doesn't dispatch any save events as it saved directly through the currency resource model bypassing any model saves. This doesn't seem possible unfortunately. Feb 18 '15 at 14:48

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.