Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You need to update a stored exchange rate for a currency using an API call with WPML and WooCommerce Multilingual.

Solution:
1. WooCommerce Multilingual (WCML) settings are stored in the

wp_options

table, under the option name

_wcml_settings

. You can update the rate in that option with custom code.
2. Use the filter hook

wcml_exchange_rates

to set the exchange rate programmatically. For more details, refer to our documentation.
3. Alternatively, you can use a third-party plugin to update the exchange rate automatically from an API. However, please note that third-party plugins are not tested by us, so we cannot guarantee compatibility with WCML. For an example of such a plugin, see this article.
4. If you are not comfortable with coding, we recommend contacting one of our certified partners from this list: WPML Contractors.

If this solution doesn't look relevant, please open a new support ticket in our support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Long Nguyen 1 year, 3 months ago.

Assisted by: Long Nguyen.

Author Posts
February 1, 2024 at 1:31 pm #15255206

christopherW-28

Using WPML with multicurrency and need to update a stored exchange rate for a currency using an API call.

Is there any documentation for available hooks / functions for the multicurrency.

I tried this, but it didnt work: update_option('woocommerce_currency_converter_rates', array('RUB' => $rate));

Thanks

February 2, 2024 at 4:10 am #15257453

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Christopher,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

The WooCommerce Multilingual (WCML) settings are stored in the table wp_options, option name "_wcml_settings". You can create a custom code and update the rate in that option.
Refer to this ticket https://wpml.org/forums/topic/wcml-get-exchange-rate/

Or use the filter hook "wcml_exchange_rates" to set the exchange rate by code. Refer to the documentation https://wpml.org/forums/topic/wcml-get-exchange-rate/

Or use a third-party plugin to update the exchange rate automatically from an API, please follow this article hidden link. Note: it is a third-party plugin and not tested so I cannot guarantee if it works properly with WCML.

If you use the code, I would like to inform you that helping you with custom code, is out of the scope of WPML.
If you are not able to accomplish this, I would recommend you contact one of our certified partners who will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/

Thanks.

February 2, 2024 at 7:08 am #15257971

christopherW-28

Good morning, thank you for your assistance.