Hello guys,
I’m integrating a multicurrency support for the ExpertHive theme and I would like to display the order total price depending on the currency by which the order has been made in the “Received Orders” section of the vendors.
e.g: a client paid the order with 29€, but in the Received Orders list it shows 29CHF because CHF is the main currency.
the file hivepress\order\edit\block\order-total.php uses the following code but it shows the total with the main currency not the currency by which the order has been paid:
<td class="hp-order__total">
<span><?php echo esc_html( $order->display_total() ); ?></span>
</td>
I tried the following code, it works but it’s not a good practice as it makes an SQL query on each order inside the loop:
<td class="hp-order__total">
<span>
<?php
$order = wc_get_order($order->get_id());
echo $order->get_order_item_totals()['order_total']['value'];
?>
</span>
</td>
Any idea how to do this ?
Thanks a lot.