Hi to all.... Just joined the forum and hope to visit on a regular basis.
To start myself off, i have a question regarding currencies.
We currently only sell products to our own country (UK) on our e-commerce site.
I'd like to offer our european visitors the ability to purchase and need a way of displaying our prices in their currency.
I've seen a couple of commercial solutions, but was curious to see how everyone else approached it.
How did you do it?
Kind Regards
Andy
Page 1 of 1
Currencies How do you do it?
#2
Posted 09 October 2009 - 12:00 PM
Hi Andy,
If you're jus interested in how to DISPLAY alternative currencies on your site, that shouldn't be too difficult.
If you're talking about allowing them to buy products in their local currency (e.g. euros), then this advice doesn't cover that. If that is what you want, you need to find out if your ecommerce solution is capable of doing that.
However, to display, the process I'd recommend is:
- Store an alternative currency (e.g. euros) conversion rate as a variable in your programming code
- To display the alternative symbol, simply use a math function in the code to multiply the original UK price by the alternative currency conversion rate.
- Make sure you put the € symbol before the math function, and limit the output to only 2 characters.
I do this on some of my sites, using PHP and a templating language called Smarty. The code would look like this:
This only applies to Smarty, but you can see the process being completed.
The only issue you also need to resolve, is that the conversion rate fluctuates all the time. The £ > € conversion rate changes daily, so you need to be able to update this conversion rate on-the-go. You might be able to find some RSS or XML feed that will update it for you, but I can't help you on that.
Hope this helps you Andy. It might be useful also to know which ecommerce software you using, whether it was custom-built or is Magento/CubeCart/X-Cart/etc.
Darren
P.S. If this was useful to you, click the Plus button to the right!
If you're jus interested in how to DISPLAY alternative currencies on your site, that shouldn't be too difficult.
If you're talking about allowing them to buy products in their local currency (e.g. euros), then this advice doesn't cover that. If that is what you want, you need to find out if your ecommerce solution is capable of doing that.
However, to display, the process I'd recommend is:
- Store an alternative currency (e.g. euros) conversion rate as a variable in your programming code
- To display the alternative symbol, simply use a math function in the code to multiply the original UK price by the alternative currency conversion rate.
- Make sure you put the € symbol before the math function, and limit the output to only 2 characters.
I do this on some of my sites, using PHP and a templating language called Smarty. The code would look like this:
€{$price * $eurorate | string_format:"%.2f"}This only applies to Smarty, but you can see the process being completed.
The only issue you also need to resolve, is that the conversion rate fluctuates all the time. The £ > € conversion rate changes daily, so you need to be able to update this conversion rate on-the-go. You might be able to find some RSS or XML feed that will update it for you, but I can't help you on that.
Hope this helps you Andy. It might be useful also to know which ecommerce software you using, whether it was custom-built or is Magento/CubeCart/X-Cart/etc.
Darren
P.S. If this was useful to you, click the Plus button to the right!
Share this topic:
Page 1 of 1
Help















