Jack_mcs Posted June 14, 2020 Author Share Posted June 14, 2020 A new version has been uploaded. It adds a version for Phoenix. No file changes are required. valquiria23 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Portman Posted September 24, 2020 Share Posted September 24, 2020 Hi, I am working on a new phoenix site, but have just realized that my auto update currency in my live site, which is 2.3.4 is not working. Yet it has only been a few months that it has not worked for ... At first I thought it was that my API key had lapsed, but I got that checked and put the link into a browser with my API key and it worked fine... so not sure why its not working... this is the error I am getting in the error log; PHP Warning: file(https://xurrency.com/api/gbp/aud/1?key=xxxx): failed to open stream: Connection refused in /home/creativ3/public_html/orders/admin/includes/functions/localization.php on line 19 PHP Warning: implode(): Invalid arguments passed in /home/creativ3/public_html/orders/admin/includes/functions/localization.php on line 20 PHP Warning: Invalid argument supplied for foreach() in /home/creativ3/public_html/orders/admin/includes/functions/localization.php on line 22 PHP Warning: Invalid argument supplied for foreach() in /home/creativ3/public_html/orders/admin/includes/functions/localization.php on line 29 if I put the link into a browser this is the response I get: {"status":"ok","code":0,"result":{"value":"1.7995","base":"gbp","target":"aud","updated_at":"2020-09-24T00:00:08Z"}} So my API Key is working.... here is the appropriate code from localization.php; function quote_xurrency_currency($base, $target = DEFAULT_CURRENCY) { if ($target == $base) return 1; $base = strtolower($base); $target = strtolower($target); $page = file('https://xurrency.com/api/' . $base . '/' . $target . '/1?key=' . XURRENCY_KEY); $result = implode(",", $page); $result = json_decode($result,true); foreach ($result as $key => $value2) { if ($key == 'code') { if ($value2 != '0') { return false; } } } foreach ($value2 as $key2 => $value3) { if ($key2 == 'value') { $value = $value3; } } if (sizeof($value) > 0) { return $value; } else { return false; } } It has been so long since I got this to work that I am having trouble working out what the problem could be - I'm obviously not the strongest coder - I can probably solve it with a couple of hours work, but if anyone with a keener eye than mine can see the problem I would really appreciate it. Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted September 24, 2020 Share Posted September 24, 2020 34 minutes ago, Portman said: PHP Warning: file(https://xurrency.com/api/gbp/aud/1?key=xxxx): failed to open stream: Connection refused in Debugging a similar error: https://stackoverflow.com/questions/15835274/php-file-get-contents-failed-to-open-stream-connection-refused More results at https://www.google.com/search?q=PHP+Warning%3A++file()%3A+failed+to+open+stream%3A+Connection+refused+in Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 24, 2020 Author Share Posted September 24, 2020 @PortmanThis is the support thread for the Auto Update Currencies addon. If you are not using a version of it, then please post in the general forum. If you are, please let me know which version of the addon you are using. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Portman Posted September 24, 2020 Share Posted September 24, 2020 hey @Jack_mcs,I It is related to Auto update currencies, I am using version 1 (as I mentioned in the post this is for my active 2.3.4 site which is going to be retired soon) I thought because Auto Update currency calls localization.php this was the place to post this, sorry if I am wrong. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 24, 2020 Author Share Posted September 24, 2020 Does the currency update work if you click the update button in admin->Localization->Currencies? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Portman Posted September 25, 2020 Share Posted September 25, 2020 (edited) No it doesn't. - does this mean it is not related to auto update? Edited September 25, 2020 by Portman Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 25, 2020 Author Share Posted September 25, 2020 That's correct. The addon doesn't change the core function so if that code no longer works, it is due to something else. This thread may help. You could try upgrading this addon to v 1.3 since, as I recall, it contains the fix for the currency. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Portman Posted September 26, 2020 Share Posted September 26, 2020 Thanks for your time @Jack_mcs Quote Link to comment Share on other sites More sharing options...
Vegetalpt Posted May 18, 2021 Share Posted May 18, 2021 I Jack need your help, i'm using the OsCommerce v2.3.4.1 and I install the Auto Update currencies V1.4 but go to admin->Configuration->My Store to try set the Auto Update Currency setting to an hour but i don't see where??? Can you help? Regards, Nuno Amaral Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 19, 2021 Author Share Posted May 19, 2021 There are settings in the admin/auto_update_currencies.php file. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Vegetalpt Posted May 20, 2021 Share Posted May 20, 2021 Sorry but what settings should I make, you can help I'm really new to this and I would like to learn a lot, thanks for your time, Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 20, 2021 Author Share Posted May 20, 2021 Find this line define('HOURS_BETWEEN_UPDATES' , '4') and change the 4 to 1. You also need to run the cron job once an hour. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Psytanium Posted September 28, 2021 Share Posted September 28, 2021 Hi Jack, What could be the problem if I can run the script directly from browser and get the rates updated, but can't run it from Cronjob. I did set it to 1 min, nothing change. This is the cron url im using : php /home/username/public_html/backend/auto_update_currencies.php Any ideas where to look ? Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 29, 2021 Author Share Posted September 29, 2021 22 hours ago, Psytanium said: php /home/username/public_html/backend/auto_update_currencies.php If that is really what is being used then you need to change "username", assuming that is not the real username. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.