
claudiobors(@claudiobors)
31 Posts
Customers
Quote from claudiobors on July 4, 2024, 16:18
Hello,
I'm using the woocommerce-currency-switcher plugin and have a requirement to convert the order currency from EUR to AED after the order has been completed. For instance, I would use the woocommerce_thankyou hook.
Is there any function I can use for this purpose?
Thank you very much.
Hello,
I'm using the woocommerce-currency-switcher plugin and have a requirement to convert the order currency from EUR to AED after the order has been completed. For instance, I would use the woocommerce_thankyou hook.
Is there any function I can use for this purpose?
Thank you very much.

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 5, 2024, 09:10
Hello
You can try this function - https://share.pluginus.net/image/i20240705100823.png
Hello
You can try this function - https://share.pluginus.net/image/i20240705100823.png

claudiobors(@claudiobors)
31 PostsTopic Author
Customers
Quote from claudiobors on July 5, 2024, 22:39
Thank you very much, I had already seen this function but I can not reuse it, when i recall the function, a function not found error is generated.
Can you give me an example of use?
Thank you very much for your availability.
Thank you very much, I had already seen this function but I can not reuse it, when i recall the function, a function not found error is generated.
Can you give me an example of use?
Thank you very much for your availability.

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 8, 2024, 09:07
Hello
Please drop me your code. I will check it
Hello
Please drop me your code. I will check it

claudiobors(@claudiobors)
31 PostsTopic Author
Customers
Quote from claudiobors on July 19, 2024, 11:17
Sure,
I would like to do something like this:
add_action('woocommerce_thankyou', 'custom_recalculate_order_data', 10, 1);
function custom_recalculate_order_data($order_id) {
if (function_exists('recalculate_order')) {
$selected_currency = 'AED';
recalculate_order($order_id, $selected_currency); }
else { error_log('La funzione recalculate_order non esiste.');
}
}
Sure,
I would like to do something like this:
add_action('woocommerce_thankyou', 'custom_recalculate_order_data', 10, 1);
function custom_recalculate_order_data($order_id) {
if (function_exists('recalculate_order')) {
$selected_currency = 'AED';
recalculate_order($order_id, $selected_currency); }
else { error_log('La funzione recalculate_order non esiste.');
}
}

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 19, 2024, 11:27
Hello
Please try to use
global $WOOCS;
$WOOCS->recalculate_order($order_id, $selected_currency);
Hello
Please try to use
global $WOOCS;
$WOOCS->recalculate_order($order_id, $selected_currency);

claudiobors(@claudiobors)
31 PostsTopic Author
Customers
Quote from claudiobors on July 19, 2024, 17:08
The function is correct in changing the currency symbol, but the numeric value remains the same, staying in the original currency even though the symbol changes.
To clarify, 1000€ converted becomes 1000 Dirhams.
Thanks a lot :)
The function is correct in changing the currency symbol, but the numeric value remains the same, staying in the original currency even though the symbol changes.
To clarify, 1000€ converted becomes 1000 Dirhams.
Thanks a lot :)

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 22, 2024, 09:10
Hello
Check the rate in the order and in the plugin settings
Hello
Check the rate in the order and in the plugin settings

claudiobors(@claudiobors)
31 PostsTopic Author
Customers
Quote from claudiobors on July 22, 2024, 17:39
Thanks a lot, problem solved :)
Thanks a lot, problem solved :)

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 23, 2024, 09:07
Great! Welcome;)
Great! Welcome;)