Woocommerce convert order total to default currency after place order
-
I’m using custom bank gateway that accept only “Macedonian denar” “MKD” – currency.
Because I’m using 3 more currencies in woocommerce, using this code:
add_filter( 'halk_amount_fix', function( $total ) { return $total * 62; } );
EUR currency and every other currency are converted (multiplied) *62 after i “Place Order”
For example:
– I want to donate 50 EUR: https://prntscr.com/1381r46
– my gateway accept only MKD (Macedonian denar)
– on the gateway page the total amount is: 50*62= 3100 MKD , which is okey for EUR currencyBut if the currency on the order page is USD $, the exchange rate for USD/MKD is *50 , using the above code, 50 USD are converted same as EUR.
How can i upgrade the function/filter to get currency first from the order, and if its USD to use *50 rate, if its EUR to use *62 rate, if its GBP to use *45 ?
- The topic ‘Woocommerce convert order total to default currency after place order’ is closed to new replies.