Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Currency updating


seb1188

Recommended Posts

Posted

I would like to have the currency values update automatically each day, rather than having to click on update values in admin.

 

I'd also like the values to update with respect to GBP instead of USD.

 

I've got as far as locating what I think is the update code in admin/currencies.php on lines 70-89.

 

But now I'm stuck.

 

Anyone know of a thread dealing with either automatic updating or changing the base currency?

Otherwise, does anyone know how to do it?!

 

Thanks.

osCommerce is GREAT. When it works...

Posted

Ok don't worry about it, I think I've found what I needed.

 

But, one question, how do you delete posts on here? This one is just going to annoy people.. "Hi, help me. No, never mind."!!!

osCommerce is GREAT. When it works...

Posted
Anyone know of a thread dealing with either automatic updating or changing the base currency?

Otherwise, does anyone know how to do it?!

 

If you go into your sites admin > localization > currencies

 

If you've just started you will probably have to add GBP as a New Currency, add the details down the right hand side and tick the Set as default (requires a manual update of currency values) check box to make it your default which will set GBP as 1.000 and the other currencies will have the rate based on that.

 

Hope this helps.

Posted
If you go into your sites admin > localization > currencies

 

If you've just started you will probably have to add GBP as a New Currency, add the details down the right hand side and tick the Set as default (requires a manual update of currency values) check box to make it your default which will set GBP as 1.000 and the other currencies will have the rate based on that.

 

Hope this helps.

 

Oh right! OK, thanks. I assumed the "you'll have to manually update" meant the update currencies button wouldn't work. Oops.

 

Thanks.

 

Now just to use an auto update contrib then...

osCommerce is GREAT. When it works...

Posted

Also, where is the XE server defined?

 

I'm getting error logs and all my currencies are being updated on oanda instead. I find xe to be more reliable and up to date so would like to fix this.

 

function quote_xe_currency($to, $from = DEFAULT_CURRENCY) {

$page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to);

 

$match = array();

 

preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match);

 

if (sizeof($match) > 0) {

return $match[1];

} else {

return false;

}

}

 

Can anyone see anything wrong with that?

osCommerce is GREAT. When it works...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...