From ac0a5b465dd96bc9421e8dafea8adc46cb0f2de2 Mon Sep 17 00:00:00 2001 From: fBrignoli Date: Thu, 26 Jan 2012 17:31:19 +0000 Subject: [PATCH] [-] Installer : Currency not installed when offline git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12729 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/LocalizationPack.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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'];