2plus
2plus

Reputation: 261

Opencart: How the auto update currency process is working

I have been analyzing the platforms for shopping cart. I heard about opencart and its auto update currency process. I have surfed to find the process. But I couldn't get solution.

How it is working? Does it use any APIs by default? Is there any possibilities for auto update failure? How can we solve that?

Please advice. Thanks.

Upvotes: 2

Views: 2949

Answers (2)

Muhammad Kholid B
Muhammad Kholid B

Reputation: 477

The answer by colmde is right, it is using Yahoo finance web service, but it is still working in my local computer connected to internet.

How it is working?

As I check the code, there are 3 conditions for currency update to run:

  1. When we are entering admin dashboard page (if auto update enabled)
  2. When we set Auto Update Currency to Yes in page Setting / Store and we save it (if auto update enabled)
  3. When we push button Refresh in page Localisation / Currencies

Does it use any APIs by default?

Yes, it is using Yahoo finance web service API as colmde mentioned

Is there any possibilities for auto update failure? How can we solve that?

Of course there is, you can see the code in /admin/model/localisation/currency.php in refresh() method. You can modify failure handling there. Currently the code will update the value of currency if the content from the web service is not empty.

Presumably it would stop working if Yahoo ever discontinued the service or changed the URL.

And you're not connected to internet.

Upvotes: 1

komodosp
komodosp

Reputation: 3616

It gets them from http://download.finance.yahoo.com/d/quotes.csv

In answer to your question, presumably it would stop working if Yahoo ever discontinued the service or changed the URL.

Upvotes: 3

Related Questions