Automatically update WCML currency rates
-
Hello,
I am trying to automatically update the WCML currency rates using this code in functions.php:
function my_wp_currencies_filter( $rates_array ) { foreach ($rates_array as $key => $value) { $rates_array[$key] = 0.5; } return $rates_array; } add_filter( 'wcml_exchange_rates', 'my_wp_currencies_filter');
I also tried this code:
function my_wp_currencies_filter( $rates_array ) { var_dump( $rates_array ); $wp_curr_rates = get_exchange_rates(); var_dump( $wp_curr_rates); return $rates_array; } add_filter( 'wcml_exchange_rates', 'my_wp_currencies_filter');
Unfortunately, on the WCML multi-currency settings in the wp backend, the rates are not updated. What is the proper way to make WP currencies update the WCML exchange rates?
PS: Just to be clear: I got an API code set in the WP Currencies settings of course 🙂
Thanks for any reply in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Automatically update WCML currency rates’ is closed to new replies.