automatic currency exchange rate update for 2.0?

I found this thread where a solution is discussed for 1.x

[url]http://forum.cs-cart.com/showthread.php?t=2437&highlight=conversion+rates[/url]



Is there anything available or in the works for 2.0?

Live Currency Rates - Pro v2

Thanks! :sunglasses:

I have developed a script to automatically update currency exchange rate for my CS-CART store:



Swimwear Place





If you can add a back link to my website on your website, I can provide you the script free of charge.

[quote name='domfang' timestamp='1265565394' post='69876']

I have developed a script to automatically update currency exchange rate for my CS-CART store:



Swimwear Place





If you can add a back link to my website on your website, I can provide you the script free of charge.

[/quote]



Please help me to add currency converter to my site at www.onlineam.com

You can use this code:

```php

/**
** Usage: Use the root of your store as the working directory for CRON
** Use this command line: php ./addons/my_changes/update_currencies.php --pw=
** where is the password used for password reminders in Administration/Settings/Security Settings
**/
define('AREA', 'A');
define('AREA_NAME', 'admin');
if( !file_exists('./prepare.php') )
chdir('../..');
require_once("./prepare.php");
require_once("./init.php");

define("RUN_FROM_CRON", empty($_REQUEST['i']) ? true : false);
define("UPDATE_DB", true);

if( RUN_FROM_CRON ) {
$cron_password = Registry::get('settings.Security.cron_password');
if( !$cron_password )
die('Bad pass');

if ((!isset($_REQUEST['pw']) || $cron_password != $_REQUEST['pw']) ) {
die(fn_get_lang_var('access_denied'));
}
}

define('cur_host', 'www.webservicex.net');
define('cur_url', cur_host."/CurrencyConvertor.asmx/ConversionRate");
define('cur_from', 'FromCurrency=');
define('cur_to', 'ToCurrency=');

function cur_get_rate($cur) {
// $request = cur_url."?".cur_from.$cur."&".cur_to.CART_PRIMARY_CURRENCY;
$request = cur_url."?".cur_to.$cur."&".cur_from.CART_PRIMARY_CURRENCY;
list($header, $response) = fn_http_request('GET', $request);
$v = preg_replace('/.*>([0-9]\.[^<]*).*/is', '$1', $response);
if( is_numeric($v) )
return $v;
return Registry::get('currencies.'.$cur."coefficient");
}

$currencies = Registry::get('currencies');

echo "
";
foreach($currencies as $currency => $data) {
if( $currency == CART_PRIMARY_CURRENCY )
continue;
$old = $data['coefficient'];
$data['coefficient'] = cur_get_rate($currency);
if( UPDATE_DB )
db_query("UPDATE ?:currencies set coefficient=?d WHERE currency_code=?s", $data['coefficient'], $currency);
echo "$currency updated from $old to $data[coefficient]\n";
}
echo "
";
exit;

?>

```