Topic: How do I convert $ to £ in Jon Lebensold's shopping cart tutorial?

Hi everyone,

I am working from Jon Lebensold's shopping cart tutorial, which is great by the way, and I'm very new to PHP.

This might seem like a stupid question, but in the video Jon is working with the currency dollars ($). I want to use pounds (£).

How do I convert $ to £? And what is the currency_code for £ for PayPal?

I did attempt to change the $$amount to this $£amount in the table output on the templates page, but nothing happened.

I also tried to put £ in the XML catalog but in the browser a greek letter A was displayed in front of the £.

Thanks for your time.

Last edited by slam38 (2009-10-16 08:46:38)

Re: How do I convert $ to £ in Jon Lebensold's shopping cart tutorial?

This is just a guess, but might be worth a try.

Special characters like £ are often unrecognised and you have to use the character code in html which is £ for £ but although this will work in text I'm not sure if it will affect the PHP processing.

I also believe that the PHP encoding needs to be utf-8 and not iso-8859-1.

I think one solution is not to use £ in a variable like $£amount just use $amount and put the £ sign as £ in a text string like
$current_prices = array("Bed"=>"£200.00",
"Chair"=>"£100.30", "Table"=>"£450.00");

as this doesn't work:-

$current_prices_in_£ = array("Bed"=>"£200.00",
"Chair"=>"£100.30", "Table"=>"£450.00");

Last edited by Wickham (2009-10-16 10:23:50)

Re: How do I convert $ to £ in Jon Lebensold's shopping cart tutorial?

Thanks Wickam,

for getting back to me, I'll give it a try.