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

Fixed Currency Rate

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.

I was looking to set fixed currency rate. I searched the forum and found the below code.

add_filter("woocs_add_custom_rate",function( $rate, $default_currency, $currency_name){

if ('JPY' == $currency_name)  {

$rate = 0.52525252 ; //set your rate

}

return $rate ;

},10,3);

Does the"woocs_add_custom_rate" work even with a rate set in the currency tab of the plugin? or does the auto rate have to be removed for the custom rate to work?

 

In my setup I have"woocs_add_custom_rate" but the site is still using rates set in the currency tab.

 

Please help

Hello

This filter overrides the rates that are taken from aggregators( from third party sites: yahoo, currencyapi, fixer   ect. )

This filter will only have no effect if you insert the  rate  manually

Thank you for the response.

 

The filter is not overriding the rate for me.

I have the below filter in my functions.php

add_filter("woocs_add_custom_rate",function( $rate, $default_currency, $currency_name){

if ('NGN' == $currency_name)  {

$rate = 980 ; //set your rate

}

return $rate ;

},10,3);

 

The front end of the site still uses the aggregator rate which is 775.

 

I am not sure what I am doing wrong.

Hello

you need to update the rate and save it - https://share.pluginus.net/image/i20230921111412.png

Thank you!

 

That did it. Works fine now.

Welcome;)