PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

manipulate several currency rates

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,

Hello,

I would like to add the same interest in % on all the currency except the main one.

The following code shows only for one currency (https://currency-switcher.com/how-to-manipulate-with-currencies-rates/)

What should I adjust in this code in order to manipulate several currency rates?

Thanks

 

 

Hello

Delete  these lines - https://c2n.me/43R3vya.png

Hello,

The code add the same interest for all the currencies.

I didn't want to add the interest on the main website currency.

I was able to achieve this result with the following code:

add_filter('woocs_currency_data_manipulation', 'woocs_currency_data_manipulation');
function woocs_currency_data_manipulation($currencies)
{
    foreach ($currencies as $key => $value)
    {
if ($key == 'USD')
        {
            $currencies[$key]['rate'] = $value['rate'];
        } else {
$currencies[$key]['rate'] = $value['rate'] + 0.1*$value['rate'];
}
   }
    return $currencies;
}

Thanks

Hello

Great!  Welcome;)