News:

AbanteCart v1.4.2.1 is released.

Main Menu

Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

Critical Error Message - Currency rate not updated

Started by everchanging, March 21, 2019, 03:36:42 PM

Previous topic - Next topic

everchanging

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?

abolabo

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

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

everchanging

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:

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):

{your table_prefix} -> This I DO change

( `store_id`, `group`, `key`, `value`) ->This I do NOT change

0, 'details', ->This I do NOT change

'alphavantage_api_key', -> I insert the API Key that I did receive

'-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

abolabo

Quote from: everchanging 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:

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


'alphavantage_api_key', -> I insert the API Key that I did receive

'-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

everchanging

#4
Hi Abolado, thanks for the quick reply.

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

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

Is

'-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?


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'];



Sam_78

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`





everchanging

#6
Hi guys, consider this topic closed.

Thank you  :)

Forum Rules Code of conduct
AbanteCart.com 2010 -