Looks like topic is back after 5 months, and it’s marked as resolved. Well when someone is doing invoice for order need to put all details in currency not just total i.e. tax, shipping, vat
https://www.ads-software.com/support/topic/how-to-get-always-the-main-currency-in-the-backend/
I put request in premium support on https://villatheme.com how much it would cost to add this solution. And after I was ignored. I decided to have a look by my own.
First idea was to overwrite wordpress>includes>admin>html-order-item. i.e.
// echo wc_price $wmc_order_base_currency;
echo wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) );
but I am not sure which global variable can I use to both currencies. $wmc_order_base_currency?
Secondly I had a look into plugin. I found this function. Can’t it be modified and used in order-item.php not just order-items.php
public function order_total_in_base_currency( $col ) {
global $post, $the_order;
if ( $col == 'order_total' ) {
if ( empty( $the_order ) || $the_order->get_id() !== $post->ID ) {
$the_order = wc_get_order( $post->ID );
}
$order_currency = get_post_meta( $post->ID, '_order_currency', true );
$wmc_order_info = get_post_meta( $post->ID, 'wmc_order_info', true );
if ( is_array( $wmc_order_info ) && count( $wmc_order_info ) ) {
foreach ( $wmc_order_info as $code => $currency_info ) {
if ( isset( $currency_info['is_main'] ) && $currency_info['is_main'] == 1 && isset( $wmc_order_info[ $order_currency ] ) ) {
if ( $order_currency != $code && floatval( $wmc_order_info[ $order_currency ]['rate'] ) ) {
$price_in_base_currency = ( $the_order->get_total() - $the_order->get_total_refunded() ) / $wmc_order_info[ $order_currency ]['rate'];
?>
<p style="color:red">
<?php echo $code . ': ' ?>
<span>
<?php echo wc_price( $price_in_base_currency, array(
'currency' => $code,
'decimals' => ! empty( $wmc_order_info[ $code ]['decimals'] ) ? (int) $wmc_order_info[ $code ]['decimals'] : 0
) ) ?>
</span>
</p>
<?php
}
break;
}
}
}
}
}
I think similar function could work in there.
That’s a process so far. I will try back if I find something how to solve this.