Support » Plugin: Payment Gateway Based Fees and Discounts for WooCommerce » Not Working with Multiple Currencies

Viewing 1 replies (of 1 total)
  • It seems it doesn’t consider the currency. To add to the currency problems:
    – when a fixed fee is set up, the amount is added as number w/o taking it’s currency
    Seems the plugin must be extended to:
    a) set up currency as well (in addition to the fixed amount)
    b) recalculate the amount based on the current currency on checkout

    QUESTION: is there any hook/filter for the fixed amount on checkout so we could extend it easily (if we suppose the amount at the settings page is for some default currency)

    P.S. Just to note that the above problem happens while the multicurrency is handled by WPML + woocommerce multilingual

    N.B. I just found the appropriate hooks and functions and here is an example code to get this (my problem) fixed (in case ‘EUR’ is the default currency):

    add_filter(‘wc_aelia_cs_convert’, ‘sc_fix_surcharge’, 10, 3);
    function sc_fix_surcharge ($amount, $base_currency, $current_currency) {
    global $woocommerce_wpml;
    if ($current_currency != ‘EUR’) {
    $exchange_rate = $woocommerce_wpml->multi_currency->exchange_rate_services->get_currency_rate($current_currency);
    if ($exchange_rate) {
    $amount *= $exchange_rate;
    }
    }
    return $amount;
    }

    • This reply was modified 1 year, 5 months ago by  dingdang.
Viewing 1 replies (of 1 total)
  • The topic ‘Not Working with Multiple Currencies’ is closed to new replies.