Please make sure to update to WPML to the latest and check our list of Known Issues before reporting

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.

This topic contains 3 replies, has 3 voices.

Last updated by kristinaF-2 1 year, 9 months ago.

Author Posts
May 16, 2018 at 6:13 am #2149995


A Payment Gateway I am using expects only Croatian currency so I am trying to update cart total and its currency by using a filter on placing order if the currency is Euro. I have successfully changed cart total but I can't change string currency . How can I do it inside following action?

// Set currency
function change_existing_currency() {
return 'HRK';

function change_total_on_checking($order) {

// Get order total
$total = $order->get_total();

// Change cart total on creating order
if(get_woocommerce_currency() === 'EUR') {

// Change currency somewhere here - currently this doesn't work
add_filter('woocommerce_currency', 'change_existing_currency', 999, 2);

// Set new cart total
$new_total = $total * get_currency_rate();


add_action( 'woocommerce_checkout_create_order', 'change_total_on_checking', 999, 1 );

So far I have tried this filters without luck:

add_action('wcml_set_client_currency', 'change_existing_currency', 999999, 1);
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 9999999); // return '&kn';
add_filter('woocommerce_currency', 'change_existing_currency', 9999999);
add_filter('wcml_client_currency', 'change_existing_currency');
add_filter('wcml_get_client_currency', 'change_existing_currency');

May 16, 2018 at 7:35 am #2150743



May 31, 2018 at 2:18 am #2253996


Could you please share how you solved it and if possible how at all you programmatically change the currency if not matching the selected payment method?

September 26, 2019 at 8:36 am #4644503


Dough.. Would you care to share your solution instead of just saying "Solved"?...