Quote from kuhada on June 1, 2020, 13:45
It seems like exchange rate gets multiplied twice with my base currency price on the cart page and in the cart widget dropdown.
My base currency is Euro, when I switch to USD conversion rate is applied twice to the euro price:
Conversion rate : EUR/USD 1.1136
 1 * 11.65 = 11.65 EUR - base [OK]
 1.1136 * 11.65 = 12.97 USD - cart widget title / site [OK]
 1.1136 * 1.1136 * 11.65 = 14.44 USD - cart widget dropdown / cart [THIS IS WRONG]
I have checked my themes cart.php WooCommerce file to see if the woocommerce_cart_item_price filter is applied twice for some reason, but it doesn't differ from the default WooCommerce cart file. Here's the relevant code:
<td class="product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
 <?php
 echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok.
 ?>
 </td>
Here's a screenshot of how it is when I'm on my base currency and what happens when I switch to USD:

And here's example of the same product when switched to USD currency:

It seems like exchange rate gets multiplied twice with my base currency price on the cart page and in the cart widget dropdown.
My base currency is Euro, when I switch to USD conversion rate is applied twice to the euro price:
Conversion rate : EUR/USD 1.1136
 1 * 11.65 = 11.65 EUR - base [OK]
 1.1136 * 11.65 = 12.97 USD - cart widget title / site [OK]
 1.1136 * 1.1136 * 11.65 = 14.44 USD - cart widget dropdown / cart [THIS IS WRONG]
I have checked my themes cart.php WooCommerce file to see if the woocommerce_cart_item_price filter is applied twice for some reason, but it doesn't differ from the default WooCommerce cart file. Here's the relevant code:
<td class="product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
 <?php
 echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok.
 ?>
 </td>
Here's a screenshot of how it is when I'm on my base currency and what happens when I switch to USD:

And here's example of the same product when switched to USD currency:
