Fatal error: Uncaught Error: Class ‘WOOMULTI_CURRENCY_Data’ not found

[ad_1]

hello i need urgent help plz
im using your plugin and on add to cart im trying to change the price to different currency but before doing that i was trying to fetch data and im getting error undefined class plz tell me what is wrong.

here is my code

add_action('woocommerce_before_calculate_totals', 'convert_cart_prices_to_ron');
function convert_cart_prices_to_ron($cart) {
    if (is_admin() && !defined('DOING_AJAX')) return;

    $selected_currency = get_woocommerce_currency();
    $conversion_rate = 1;

    if ($selected_currency != 'RON') {
        $currentCurrencyRate = 1;
        if(class_exists('WOOMULTI_CURRENCY_Data')) {
          $multiCurrencySettings = WOOMULTI_CURRENCY_Data::get_ins();
          $wmcCurrencies = $multiCurrencySettings->get_list_currencies();

          $currentCurrency = $multiCurrencySettings->get_current_currency();
          $currentCurrencyRate = floatval( $wmcCurrencies[ $currentCurrency ]['rate'] );

        }
    }

    foreach ($cart->get_cart() as $cart_item) {
        $price = $cart_item['data']->get_price();
        $cart_item['data']->set_price($price / $conversion_rate);
    }
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer