mds Posted August 17, 2019 Share Posted August 17, 2019 @dragan Thanks! That was easy. It worked. Link to comment Share on other sites More sharing options...
adrian Posted August 17, 2019 Share Posted August 17, 2019 Anyone new to this module, please be aware of this unfixed issue: https://github.com/ryancramerdesign/ServiceCurrencyConversion/issues/1 1 Link to comment Share on other sites More sharing options...
froot Posted March 13 Share Posted March 13 I'm having troubles using the methods ->getName() and ->getNames() $cc = wire('modules')->get('ServiceCurrencyConversion'); $currencyArray = $cc->getNames(); // array (0) $currency = 'HKD'; $cc->getName($currency); // null warnings: PHP Warning: Undefined array key "HKD" in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 PHP Warning: Trying to access array offset on value of type null in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 I logged into my openexchangerates.org account and there seems to be no outage. Any ideas what this could be? Link to comment Share on other sites More sharing options...
ryan Posted March 13 Author Share Posted March 13 @fruid Make sure you are using the newest version (version 3). Go to Modules > Site > ServiceCurrencyConversion. At the bottom is a checkbox to "Refresh rate data now". Check the box and save. Now make sure that you see HKD in the table shown on the configuration screen. If you don't, edit your /site/modules/ServiceCurrencyConversion/currencies.txt file and make sure it's in there, adding it if it isn't, and refreshing again. If you don't see any data loaded, I'm guessing that your server is blocking the outbound http request to the exchange rates API. You could modify the module WireHttp call to force it to use CURL or fopen, depending on what your server supports. Let me know if you need help. Link to comment Share on other sites More sharing options...
froot Posted March 13 Share Posted March 13 1 hour ago, ryan said: At the bottom is a checkbox to "Refresh rate data now" Thanks @ryan I didn't see that checkbox but I did see an input field Number of Seconds to Cache Exchange Rate Data It was set to 86400, so I set it to 0 and saved. Then I was able to see the table with all codes, names, symbols and rates. Now I also see the checkbox. Weird, I am still on version 3. Anyways, yes, HKD is listed. (Actually not one currency was working before). Now it seems to work again. I wonder, if I need to do this regularly i.e. lower the number of seconds when the cache is cleared? Link to comment Share on other sites More sharing options...
ryan Posted March 14 Author Share Posted March 14 @fruid The cache time should be fine. I'm guessing maybe it just didn't work on the first use for whatever reason, and the non-working data was cached. 1 Link to comment Share on other sites More sharing options...
froot Posted March 29 Share Posted March 29 I'm facing a similar issue now, this PHP Warning: Undefined array key "EUR" in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 PHP Warning: Trying to access array offset on value of type null in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 and this is what it says in the module settings: ServiceCurrencyConversion: access_restricted - Access restricted until 2024-04-14 (reason: too_many_requests). If there has been a mistake, please contact support@openexchangerates.org. And the site is not even live, I'm still developing locally, so it's just me requesting. I have a free account with Open Exchange Rates. I wonder if I just programmed the request-handling poorly, I assumed the module would make a request to Open Exchange Rates via API and then cache the results somewhere? Or do I need to cache it somehow manually? I don't need real-time exchange rates, maybe just one per day for what ever currency is requested would be more than sufficient. 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