Akira71 Posted January 10, 2005 Posted January 10, 2005 I have need of using numeric country codes instead of the normal 2 or 3 digit alpha codes. For instance I would like to use 840 for the United States of America. This is how our billing engine actually works. Also for states there needs to be the normal 2 digit abbreviation. I did not see it already in the code as it was, but I am very bad at finding some things that I need. I do have all the codes I need and could create a MySQL table for it, but I thought this must have been a common request and perhaps it has been done. Does anyone know if it has? Sincerely, Akira
Akira71 Posted January 11, 2005 Author Posted January 11, 2005 I am bumping this again, just in case. I did create a lookup table that I can pull up the Country ID based on the 2 letter or three letter ISO code. Now, what is the best way to get those codes? I am using something like this: <code> $order->billing['country']['title']['iso_code_3']) </code> However for the US it always seems to return 'U'. Anyone have any ideas? Thank you in advance, Akira
♥Vger Posted January 11, 2005 Posted January 11, 2005 osCommmerce already has the numeric codes in its database. As for the two letter iso codes, you would have to add data to your database to put those codes in there if they don't already exist. Vger
Akira71 Posted January 11, 2005 Author Posted January 11, 2005 osCommmerce already has the numeric codes in its database. As for the two letter iso codes, you would have to add data to your database to put those codes in there if they don't already exist. Vger <{POST_SNAPBACK}> Thank you. It is actually the numeric codes that I want. For some reason I seem to be unable to get the correct codes no matter what I do. It is strange. However I did not see the numeric codes in the database so I ended up creating my own table. I would much rather prefer to keep it to the basic osCommerce tables and not use a custom table for this. How might I access the basic numeric codes from osCommerce? Thank you again VGer. You have been a tremendous help. BTW the server issue we were facing last week was solved by a complete and total re-install. Then osCommerce worked beautifully for the show.
♥Vger Posted January 11, 2005 Posted January 11, 2005 In your database, in the Countries table, there are listings for: countries_id (numeric) countries_name countries_iso_code_2 countries_iso_code_3 address_format_id Vger
Akira71 Posted January 11, 2005 Author Posted January 11, 2005 In your database, in the Countries table, there are listings for: countries_id (numeric) countries_name countries_iso_code_2 countries_iso_code_3 address_format_id Vger <{POST_SNAPBACK}> Ah yes, but those are the alpha codes for the countries. For instance United States is US or USA, but what I need is the ISO numeric code -> 840. I did create a table that has this data. However I really wanted to do it from within osCommerce system. It does not sound possible. Also the secondary issue I am facing is where when calling for the code, even the alpha code, it always returns 'U' for United States. It never seems to return US or USA. Thank you, Akira
Recommended Posts
Archived
This topic is now archived and is closed to further replies.