Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter paweuek

    (@paweuek)

    I think I’ve managed to figure this out:

    add_filter('wc_price_history_lowest_price_html_raw_value_taxed', function ($price, $wc_product) {

    function wcml_get_currency_rate($currency_code)

    {

    if (class_exists('WCML_Multi_Currency')) {

    $wcml_multi_currency = new \WCML_Multi_Currency();

    $currencies = $wcml_multi_currency->get_currencies();

    if (isset($currencies[$currency_code])) {

    return $currencies[$currency_code]['rate'];

    }

    }

    return 1;

    }

    if (class_exists('WCML_Multi_Currency')) {

    $current_currency = get_woocommerce_currency();

    $default_currency = get_option('woocommerce_currency');

    if ($current_currency !== $default_currency) {

    $exchange_rate = wcml_get_currency_rate($current_currency);

    $price = $price * $exchange_rate;

    }

    }

    return $price;

    }, 10, 2);
    Plugin Author kkarpieszuk

    (@kkarpieszuk)

    Hi, it is late answer but I wanted to thank you for figuring this out and the snippet. I hope other people are benefiting from our solution

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.