Support Forum

Content of the article

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

manipulate several currency rates

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see green button on the right side) and press Save button.
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. 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;)