#438 Updating Currency Rates

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Olivier on Sunday, 24 August 2025 02:40 UTC

Howard Lowndes

My Joomla is 5.3.3 and my J2Commerce extension is 4.0.17 running on Debian 12 on a Raspberry Pi 4 with 8G of RAM.
My problem is setting getting multiple currencies in J2Commerce to auto update.

I am pulling exchange rates from api.exchangerate.host with an assigned API key. That works fine and the JSON result looks as expected.

{"success":true,"terms":"https:\/\/currencylayer.com\/terms","privacy":"https:\/\/currencylayer.com\/privacy","timestamp":1756000386,"source":"AUD","quotes":{"AUDUSD":0.6468,"AUDEUR":0.551788,"AUDGBP":0.482057,"AUDBTC":5.527992e-6}}

In Joomla I have a scheduled task set up to run every 24 hours and that appears to be fine:
http://api.exchangerate.host/live?access_key=<REDACTED>&source=AUD&currencies=USD,EUR,GBP,BTC&format=1


Also under WebCron I have:
https://<REDACTED>.au/index.php/component/ajax?plugin=RunSchedulerWebcron&group=system&format=json&hash=<REDACTED>

In J2Commerce:Currencies I have my default currency (AUD) set at 1.0 and all other currencies set at 0.0 - I tried setting the non-defaults to NULL but that gave a MySQL error.

My problem is that there appears to be a stage needed between getting the JSON and updating the currencies and I can't work out what that missing stage is.

TIA

Olivier

Hello Howard,

as far as I understand, you are getting the information you need but you don't seem to do anything with it.

There needs to be something that uses the json file received and add the values into the j2store_currencies table.

The code needs to test the currency code (currency_code column) and set the currency value (currency_value column). Ultimately, the modified_on column should be set as well.

I think that is what is missing.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.