Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change currency depending on customer country


anabrolic

Recommended Posts

I would like to be able to change the currency after login, depending on the customer s country. The default currency is set to USD but i would like when a customer from France logs in, to automatically change the currency to EUR.

 

I found something and it works but someone said it s not a good idea... what do you think? I don t want to manually add all the countries of Europe in the code below.

 

(in login.php)

 

if($check_country['entry_country_id'] == 34)

{

$currency = 'EUR';

}

elseif($check_country['entry_country_id'] == etc.)

{

$currency = 'etc.';

Link to comment
Share on other sites

I agree with Mel. What happens if you have an American living in France? He may not want his currency forced to non-US. Also, the check you mentioned would require a login and that might cause confusion for the customer. You may want to look at the Second Currency contribution (see My Addons). It will allow your customer to show two currencies.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The Second Currency contribution will help a little with that since it will display both currencies, even in the order confirmation email. It won't force them to change currencies though. The first method you mentioned, or something similar, would work but I'm afraid it would create more problems since it is controlling the customers settings. I could be wrong though so you could try it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...