{"action":"opened","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/4963","repository_url":"https://api.github.com/repos/Sylius/Sylius","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/4963/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/4963/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/4963/events","html_url":"https://github.com/Sylius/Sylius/issues/4963","id":153425569,"number":4963,"title":"EuropeanCentralBankImporter forces baseCurrency to Euro","user":{"login":"starspire","id":8075738,"avatar_url":"https://avatars.githubusercontent.com/u/8075738?v=3","gravatar_id":"","url":"https://api.github.com/users/starspire","html_url":"https://github.com/starspire","followers_url":"https://api.github.com/users/starspire/followers","following_url":"https://api.github.com/users/starspire/following{/other_user}","gists_url":"https://api.github.com/users/starspire/gists{/gist_id}","starred_url":"https://api.github.com/users/starspire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starspire/subscriptions","organizations_url":"https://api.github.com/users/starspire/orgs","repos_url":"https://api.github.com/users/starspire/repos","events_url":"https://api.github.com/users/starspire/events{/privacy}","received_events_url":"https://api.github.com/users/starspire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-06T10:41:38Z","updated_at":"2016-05-06T10:41:38Z","closed_at":null,"body":"Hi, \r\nas I wrote in title EuropeanCentralBankImporter forces baseCurrency to Euro. It can leads to errors if someone like me set his to PLN. In this situation Importer first set PLN exchange rate to 1.0 but later overwrite this and other rates by values compared to euro. Event more, the euro rate doesn't change at all. I fixed this problem for my own usage by creating own Importer:\r\n```\r\n<?php\r\n\r\n/*\r\n * This file is part of the Sylius package.\r\n *\r\n * (c) Paweł Jędrzejewski\r\n *\r\n * For the full copyright and license information, please view the LICENSE\r\n * file that was distributed with this source code.\r\n */\r\n\r\nnamespace AppBundle\\Importer;\r\n\r\nuse Sylius\\Component\\Currency\\Importer\\AbstractImporter;\r\n\r\nclass SmartByteImporter extends AbstractImporter\r\n{\r\n    /**\r\n     * @var string\r\n     */\r\n    private $url = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml';\r\n\r\n    /**\r\n     * @var string\r\n     */\r\n    private $baseCurrency;\r\n\r\n    /**\r\n     * {@inheritdoc}\r\n     */\r\n    public function configure(array $options = [])\r\n    {\r\n        if (!isset($options['base_currency'])) {\r\n            throw new \\InvalidArgumentException('\"base_currency\" must be set in order to use EuropeanCentralBankImporter.');\r\n        }\r\n\r\n        $this->baseCurrency = $options['base_currency'];\r\n    }\r\n\r\n    /**\r\n     * {@inheritdoc}\r\n     */\r\n    public function import(array $managedCurrencies = [])\r\n    {\r\n        $xml = @simplexml_load_file($this->url);\r\n        if ($xml instanceof \\SimpleXMLElement) {\r\n            $this->updateOrCreate($managedCurrencies, $this->baseCurrency, 1.00);\r\n            $data = $xml->xpath('//gesmes:Envelope/*[3]/*');\r\n            if($this->baseCurrency != 'EUR'){\r\n                foreach ($data[0]->children() as $child) {\r\n                    if((string) $child->attributes()->currency == $this->baseCurrency){\r\n                        $baseRate = (float) $child->attributes()->rate;\r\n                        break;\r\n                    }\r\n                }\r\n                $this->updateOrCreate($managedCurrencies, 'EUR', 1.00/$baseRate);\r\n            }\r\n            \r\n            foreach ($data[0]->children() as $child) {\r\n                if((string) $child->attributes()->currency != $this->baseCurrency)\r\n                    $this->updateOrCreate($managedCurrencies, (string) $child->attributes()->currency, (float) $child->attributes()->rate/$baseRate);\r\n            }\r\n\r\n            $this->manager->flush();\r\n        }\r\n    }\r\n}\r\n\r\n```\r\nTell me if You want to write me a contribute patch based on this."}}