zelddaniel Posted February 26, 2018 Share Posted February 26, 2018 (edited) Hello, I was wondering through the prestashop forum and all that i find is solution for Prestashop 1.6 or older.. here, here and here. Probably the answer is inbetween but I dont speak "programmer" so good. Could anyone please share a method as how we could add our own bank currency rates, such as http://www.bnr.ro/nbrfxrates.xml ? Many thanks in advance, from me and all romanians Edited February 26, 2018 by zelddaniel (see edit history) Link to comment Share on other sites More sharing options...
zelddaniel Posted February 26, 2018 Author Share Posted February 26, 2018 (edited) 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 ''; } Edited February 26, 2018 by zelddaniel (see edit history) Link to comment Share on other sites More sharing options...
zelddaniel Posted March 5, 2018 Author Share Posted March 5, 2018 up Link to comment Share on other sites More sharing options...
zelddaniel Posted March 16, 2018 Author Share Posted March 16, 2018 up Link to comment Share on other sites More sharing options...
zelddaniel Posted March 26, 2018 Author Share Posted March 26, 2018 up Link to comment Share on other sites More sharing options...
zelddaniel Posted September 28, 2018 Author Share Posted September 28, 2018 up Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now