FOX - WooCommerce Currency Switcher Professional

LearnPress – WordPress LMS Plugin

Plugin URL: https://wordpress.org/plugins/learnpress/

  • In  file wp-content\plugins\learnpress-woo-payment\incs\class-wc-product-lp-course.php change next code:
    $price = ($course) ? $course->get_price() : 0;
    if ($price) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $price = $WOOCS->woocs_exchange_value(floatval($price));
            }
        }
    }
    return $price;
    

  • In file wp-content\plugins\learnpress\inc\course\abstract-course.php add next code:
    if ($sale_price_value) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $sale_price_value = $WOOCS->woocs_exchange_value(floatval($sale_price_value));
            }
        }
    }
    

  • And in functions.php of the current wp theme add next code:
    add_filter('learn-press/course/regular-price', function ($price, $id) {
        if ($price) {
            if (class_exists('WOOCS')) {
                global $WOOCS;
                if ($WOOCS->is_multiple_allowed) {
                    $price = $WOOCS->woocs_exchange_value(floatval($price));
                }
            }
        }
        return $price;
    }, 10, 2);
    
    add_filter('learn-press/currency', function ($currency) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            $currency = $WOOCS->current_currency;
        }
        return $currency;
    });