diff --git a/classes/LocalizationPack.php b/classes/LocalizationPack.php index b3c85426c..4a512992c 100644 --- a/classes/LocalizationPack.php +++ b/classes/LocalizationPack.php @@ -238,12 +238,7 @@ class LocalizationPackCore { if (isset($xml->currencies->currency)) { - if (!$feed = Tools::simplexml_load_file('http://api.prestashop.com/xml/currencies.xml') - && !$feed = @simplexml_load_file(dirname(__FILE__).'/../localization/currencies.xml')) - { - $this->_errors[] = Tools::displayError('Cannot parse the currencies XML feed.'); - return false; - } + foreach ($xml->currencies->currency as $data) { @@ -276,8 +271,10 @@ class LocalizationPackCore PaymentModule::addCurrencyPermissions($currency->id); } } - - Currency::refreshCurrencies(); + if (!$feed = Tools::simplexml_load_file('http://api.prestashop.com/xml/currencies.xml')) + $this->_errors[] = Tools::displayError('Cannot parse the currencies XML feed.'); + else + Currency::refreshCurrencies(); if (!count($this->_errors) && $install_mode && isset($attributes['iso_code']) && count($xml->currencies->currency) == 1) $this->iso_currency = $attributes['iso_code'];