I hope someone can help me with this! I´m using this plugin WooCommerce Currency Switcher by PluginUs.NET. everything works fine until I go to the cart page in there the price is a converter for a second time, first is converted before adding into the cart, and then inside cart page.
So I search in there support page and found this topic that suggests this solution but when I add the code everything is still the same, maybe its because the code was made three years ago and now is not supported in the new Woocommerce version, this is the code that is suggested:
add_action('woocommerce_before_calculate_totals', 'fix_currency_conversion');
function fix_currency_conversion($cart_object){
global $WOOCS;
$cur_currency = $WOOCS->current_currency;
$currencies = $WOOCS->get_currencies();
$conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
if($cur_currency == 'HKD'){
foreach ( $cart_object->cart_contents as $cart_item_key => $cart_item ) {
$cart_item['data']->price = $cart_item['data']->price / $conversion_rate;
}
}
}
It is late but it will be helpful for other.
You need to change:
$cart_item['data']->price = $cart_item['data']->price / $conversion_rate;
WITH
$cart_item['data']->set_price($cart_item['data']->price / $conversion_rate);