Quote from kodomastro on November 7, 2022, 06:39
Hello,
I noticed currency aggregator xe.com is not visible and not available to choose in Settings -> WOOCS -> Options -> Currency aggregator but...
I see code of this aggregator in woocs.php in line 3072:
case 'xe':
$amount = urlencode(1);
$from_Currency = urlencode($this->default_currency);
$to_Currency = urlencode($this->escape($_REQUEST['currency_name']));
//http://www.xe.com/currencyconverter/convert/?Amount=1&From=ZWD&To=CUP
$url = "http://www.xe.com/currencyconverter/convert/?Amount=1&From=" . $from_Currency . "&To=" . $to_Currency;
if (function_exists('curl_init') AND $woocs_use_curl) {
$html = $this->file_get_contents_curl($url);
} else {
$html = file_get_contents($url);
}
//test converterresult-toAmount
preg_match_all('/<span class=\'uccResultAmount\'>(.*?)<\/span>/s', $html, $matches);
if (isset($matches[1][0])) {
$request = floatval(str_replace(",", "", $matches[1][0]));
} else {
$request = sprintf(esc_html__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
}
break;
Is there an option to enable this aggregator?
Thank you.
Best,
Patrick
Hello,
I noticed currency aggregator xe.com is not visible and not available to choose in Settings -> WOOCS -> Options -> Currency aggregator but...
I see code of this aggregator in woocs.php in line 3072:
case 'xe':
$amount = urlencode(1);
$from_Currency = urlencode($this->default_currency);
$to_Currency = urlencode($this->escape($_REQUEST['currency_name']));
//http://www.xe.com/currencyconverter/convert/?Amount=1&From=ZWD&To=CUP
$url ="http://www.xe.com/currencyconverter/convert/?Amount=1&From=" . $from_Currency ."&To=" . $to_Currency;
if (function_exists('curl_init') AND $woocs_use_curl) {
$html = $this->file_get_contents_curl($url);
} else {
$html = file_get_contents($url);
}
//test converterresult-toAmount
preg_match_all('/<span class=\'uccResultAmount\'>(.*?)<\/span>/s', $html, $matches);
if (isset($matches[1][0])) {
$request = floatval(str_replace(",","", $matches[1][0]));
} else {
$request = sprintf(esc_html__("no data for %s", 'woocommerce-currency-switcher'), $this->escape($_REQUEST['currency_name']));
}
break;
Is there an option to enable this aggregator?
Thank you.
Best,
Patrick