Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Critical Error Message - Currency rate not updated  (Read 8339 times)

Offline everchanging

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
    • View Profile
    • Ancient Greece Reloaded
Critical Error Message - Currency rate not updated
« on: March 21, 2019, 03:36:42 PM »
Hi guys,

I received the following Critical error message:

Message status:
critical
Date:
...
Number of repetitions:
3
Currency Auto Updater Warning: Currency rate code GBP not updated. Trace: #0
…/admin/model/localisation/currency.php on line 230 #1
…/admin/controller/pages/index/home.php on line 173 #2 on line #3
…/core/engine/dispatcher.php on line 293 #4
…/core/engine/dispatcher.php on line 328



How can I resolve this?
« Last Edit: March 22, 2019, 04:45:24 AM by Basara »
"I know one thing; that I know nothing"

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Critical Error Message - Help needed
« Reply #1 on: March 22, 2019, 04:42:57 AM »
1. you have enabled currency updater.
2. every time you login into admin it make api request to 3d-party service and ask currency exchenge rates  for all of your currencies.
3. Abantecart have hardcoded API-key to make these requests. This key is free and have limitation.
4. To solve issue you shoult to get your own API-key here https://www.alphavantage.co
5. Then go to phpMyAdmin, open table settings and add row with this SQL query

Code: [Select]
INSERT INTO `{your table_prefix}settings`( `store_id`, `group`, `key`, `value`) VALUES ( 0, 'details',   'alphavantage_api_key',  '-your-own-api-key-');
Just paste your table prefix and your own api-key value.

Or make it via phpMyAdmin adding new row form
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline everchanging

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
    • View Profile
    • Ancient Greece Reloaded
Re: Critical Error Message - Currency rate not updated
« Reply #2 on: March 22, 2019, 02:18:35 PM »
Hi abalabo and thank you for your reply.

I did go to alphavantage and I did get my API Key.

Just for clarification reasons and to see if I have understood you correctly.

In the following code:
Code: [Select]
INSERT INTO `{your table_prefix}settings`( `store_id`, `group`, `key`, `value`) VALUES ( 0, 'details',   'alphavantage_api_key',  '-your-own-api-key-');

I do the following changes (if I am wrong please correct me):

Code: [Select]
{your table_prefix} -> This I DO change

Code: [Select]
( `store_id`, `group`, `key`, `value`) ->This I do NOT change

Code: [Select]
0, 'details', ->This I do NOT change

Code: [Select]
'alphavantage_api_key', -> I insert the API Key that I did receive

Code: [Select]
'-your-own-api-key-' -> and what do I do here since the API Key that I did receive goes in the previous section?

I thank you in advance
"I know one thing; that I know nothing"

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Critical Error Message - Currency rate not updated
« Reply #3 on: March 22, 2019, 02:26:55 PM »
Hi abalabo and thank you for your reply.

I did go to alphavantage and I did get my API Key.

Just for clarification reasons and to see if I have understood you correctly.

In the following code:
Code: [Select]
INSERT INTO `{your table_prefix}settings`( `store_id`, `group`, `key`, `value`) VALUES ( 0, 'details',   'alphavantage_api_key',  '-your-own-api-key-');

Code: [Select]
'alphavantage_api_key', -> I insert the API Key that I did receive

Code: [Select]
'-your-own-api-key-' -> and what do I do here since the API Key that I did receive goes in the previous section?

I thank you in advance

do not change ''alphavantage_api_key' - it's a name of setting.
Just replace -your-own-api-key- with API-key that you got
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline everchanging

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
    • View Profile
    • Ancient Greece Reloaded
Re: Critical Error Message - Currency rate not updated
« Reply #4 on: March 22, 2019, 02:35:52 PM »
Hi Abolado, thanks for the quick reply.

So the only thing that I do change in the following code is:

Code: [Select]
INSERT INTO `{your table_prefix}settings`( `store_id`, `group`, `key`, `value`) VALUES ( 0, 'details',   'alphavantage_api_key',  '-your-own-api-key-');
Is

Code: [Select]
'-your-own-api-key-' -> with the API KEY that I did receive?

Thanks again

***Update:***

I apologize for the bombardment of my questions, but which table do I use for "your table_prefix"? I am looking at a ton of tables right now and I do not want to mess with them?


***Update 2:***

Instead of going to the database, can I not do the following?

To change directly the Api Key with the new that I did receive in the code below?

Code: [Select]
public function updateCurrencies()
    {
        $this->load->model( 'setting/setting' );
        $settings = $this->model_setting_setting->getSetting( 'details', 0 );
        $api_key = isset( $settings['alphavantage_api_key'] ) && $settings['alphavantage_api_key'] ? $settings['alphavantage_api_key'] : '************'; <<<------ This one here -------
        $base_currency_code = $settings['config_currency'];

« Last Edit: March 22, 2019, 03:03:24 PM by everchanging »
"I know one thing; that I know nothing"

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Critical Error Message - Currency rate not updated
« Reply #5 on: March 22, 2019, 03:28:45 PM »
INSERT INTO `{your table_prefix}settings`( `store_id`, `group`, `key`, `value`) VALUES ( 0, 'details',   'alphavantage_api_key',  '-your-own-api-key-');

{your table_prefix} means if you have a table names `ac_settings` in your database if not then use just `settings`

To verify this go to you database and scroll at the very bottom there should be a table named `settings` if you have added some prefix to it then `prefix_settings`





Offline everchanging

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
    • View Profile
    • Ancient Greece Reloaded
Re: Critical Error Message - Currency rate not updated
« Reply #6 on: March 22, 2019, 03:53:13 PM »
Hi guys, consider this topic closed.

Thank you  :)
« Last Edit: March 23, 2019, 10:23:23 AM by everchanging »
"I know one thing; that I know nothing"

 

Powered by SMFPacks Social Login Mod