WOOCS - WooCommerce Currency Switcher

WooCommerce Smart COD

The plugin URL: https://wordpress.org/plugins/wc-smart-cod/

  • In file functions.php of your current wordpress theme add next code:
    add_filter('wc_smart_cod_fee', function($fee, $settings) {
        if (class_exists('WOOCS') AND $fee) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $currrent = $WOOCS->current_currency;
                if ($currrent != $WOOCS->default_currency) {
                    $currencies = $WOOCS->get_currencies();
                    $rate = $currencies[$currrent]['rate'];
                    $fee = $fee * $rate;
                }
            }
        }
        return $fee;
    }, 2, 100);