Support Forum

Content of the article

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

Please add BNR selector

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.

Hi!

I need to have as a selector:

https://www.bnr.ro/nbrfxrates.xml

It worked for me in the previous versions by altering the ECB selector (code bellow). Now is not working anymore. Can you inlude it in your plugin into the future updates? My license has expired but i am prepared to buy a new one if you will include bnr selector, otherwise i can't use the plugin. Thank you!

case 'ecb':
$url = 'http://www.bnro.ro/nbrfxrates.xml';
if (function_exists('curl_init') AND $woocs_use_curl) {
$res = $this->file_get_contents_curl($url);
} else {
$res = file_get_contents($url);
}
$currency_data = simplexml_load_string($res);
$rates = array();
if (empty($currency_data->Body->Cube)) {
$request = sprintf(__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
break;
}
foreach ($currency_data->Body->Cube->Rate as $xml) {
$att = (array) $xml->attributes();
$final['rate'] = (string) $xml;
$rates[$att['@attributes']['currency']] = floatval($final['rate']);
}
//***
if (!empty($rates)) {

if ($this->default_currency != 'RON') {
if ($_REQUEST['currency_name'] != 'RON') {
if (isset($_REQUEST['currency_name'])) {
$request = floatval($rates[$this->escape($_REQUEST['currency_name'])] / $rates[$this->default_currency]);
} else {
$request = sprintf(__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
}
} else {
$request = ($rates[$this->default_currency]);
$request = $request + $request * 1/100;

}
} else {
if ($_REQUEST['currency_name'] != 'RON') {
if ($rates[$_REQUEST['currency_name']] < 1) {
$request = 1 / $rates[$_REQUEST['currency_name']];
} else {
$request = $rates[$_REQUEST['currency_name']];
}
} else {
$request = 1;
}
}
} else {
$request = sprintf(__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
}
//***

if (!$request) {
$request = sprintf(__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
}
break;

 

Hello

I  will  add  it  to  next  version.

But  you can use - https://c2n.me/42TgDM5.png ( to get free API key - https://free.currencyconverterapi.com/free-api-key)

Result:  https://c2n.me/42TgRpd