Support Forum

Content of the article

WPBE - WordPress Posts Bulk Editor Professional
You need to log-in to create request (topic) to the support

manipulate several currency rates

(new from 01-07-2019)
If you not got email within 24 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer 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;)