prestamin Posted September 10, 2013 Share Posted September 10, 2013 Hi, i'm using prestashop 1.5.4.1 and i wonder how can I change the bank as a source for currency rate s conversion? Thank you. Link to comment Share on other sites More sharing options...
prestamin Posted September 10, 2013 Author Share Posted September 10, 2013 (edited) Well i gues i have to change this function in classes/Currency.php: To answer my own question , first i have to add cron that will generate http://mydomain.com/xml/currencies.xml from whatever bank i want and after that i need to change function to point and parse my newly generated XML. public static function refreshCurrencies() { // Parse //if (!$feed = Tools::simplexml_load_file('http://api.prestashop.com/xml/currencies.xml')) if (!$feed = Tools::simplexml_load_file('http://mydomain.com/xml/currencies.xml')) return Tools::displayError('Cannot parse feed.'); // Default feed currency (EUR) $isoCodeSource = strval($feed->source['iso_code']); if (!$default_currency = Currency::getDefaultCurrency()) return Tools::displayError('No default currency'); $currencies = Currency::getCurrencies(true, false); foreach ($currencies as $currency) if ($currency->id != $default_currency->id) $currency->refreshCurrency($feed->list, $isoCodeSource, $default_currency); } Just an idea. Needs to be tested Edited September 10, 2013 by prestamin (see edit history) 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