I tried
public static function refreshCurrencies()
{
// Parse
if (!$feed = Tools::simplexml_load_file('http://www.bnr.ro/nbrfxrates.xml')) {
return Context::getContext()->getTranslator()->trans('Cannot parse feed.', array(), 'Admin.Notifications.Error');
}
// Default feed currency (EUR)
$isoCodeSource = strval($feed->source['EUR']);
if (!$defaultCurrency = Currency::getDefaultCurrency()) {
return Context::getContext()->getTranslator()->trans('No default currency', array(), 'Admin.Notifications.Error');
}
$currencies = Currency::getCurrencies(true, false, true);
foreach ($currencies as $currency) {
/** @var Currency $currency */
if ($currency->id != $defaultCurrency->id) {
$currency->refreshCurrency($feed, $isoCodeSource, $defaultCurrency);
}
}
return '';
}