FOX - Currency Switcher for WooCommerce

Fancy Product Designer

Plugin linkhttps://codecanyon.net/item/fancy-product-designer-woocommercewordpress/6318393 In file \wp-content\plugins\fancy-product-designer\inc\class-frontend.php add next code:
var price = fancyProductDesigner.calculatePrice();
if (woocs_current_currency != 'undefined' && woocs_current_currency['rate'] != 'undefined')
    {
     var dec = 1;
     if (woocs_current_currency['decimals']) {
        dec = Math.pow(10, woocs_current_currency['decimals']);
    }
    price = Math.round(price * woocs_current_currency['rate'] * dec) / dec;

}
Add next code in the same file:
if (class_exists('WOOCS')) {
    global $WOOCS;
    $currencies = $WOOCS->get_currencies();
    $cur_cur = $WOOCS->current_currency;
    if ($cur_cur != $WOOCS->default_currency) {
        $sign = $currencies[$cur_cur]['symbol'];
        switch ($currencies[$cur_cur]['position']) {
            case 'right':
            case 'right_space':
                $price_format = "%d" . $sign;
                break;
            case 'left':
            case 'left_space':
            default:
                $price_format = $sign . "%d";
        }
    }
}

In file \wp-content\plugins\fancy-product-designer\inc\api\class-product-settings.php add next code:
if ($parameter == 'price') {
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $value = $WOOCS->woocs_exchange_value(floatval($value));
        }
    }
}

In file \wp-content\plugins\fancy-product-designer\inc\api\class-product-settings.php add next code:
if ($parameter == 'price') {
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $value = $WOOCS->woocs_exchange_value(floatval($value));
        }
    }
}

In file wp-content\plugins\fancy-product-designer\woo\class-wc-cart.php add next code:
if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->is_multiple_allowed) {
        $currrent = $WOOCS->current_currency;
        if ($currrent != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $rate = $currencies[$currrent]['rate'];
            $_POST['fpd_product_price'] = $_POST['fpd_product_price'] / $rate;
        }
    }
}
Also on the same file add next code:
$tmp_price = $product->get_price();
if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->is_multiple_allowed) {
        $currrent = $WOOCS->current_currency;
        if ($currrent != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $rate = $currencies[$currrent]['rate'];
            $tmp_price = $tmp_price / $rate;
        }
    }
}
$final_price = $final_price < $tmp_price ? $tmp_price : $final_price;
This edit is inside another plugin's file, so a plugin update will undo it. Write the change down, and re-apply it after every update of that plugin — or ask its authors to include the fix on their side, which is the only version that survives. If the change is inside FOX itself, tell us: a fix that has to be re-applied by hand is a bug on our side, not a solution.