glynwilliams Posted March 27, 2021 Share Posted March 27, 2021 HI there I'm pulling data out of the Order_Summary table and the State and Country Columns both contain numeric codes rather than character strings. Does anyone know where I can get the cross reference data from to convert these numbers into country and state names please ? I've had a look in the DB Schema and I can't seem to find anything. Any help really appreciated. Kind Regards Glyn. Link to comment Share on other sites More sharing options...
bsmither Posted March 27, 2021 Share Posted March 27, 2021 If it is code that runs under CubeCart control, you can use the common functions getCountryFormat() and getStateFormat(). The input parameters for both are: $input : the value of whatever it is that you have $match : the name of whatever it is that you have (default 'numcode' for country, or 'id' for state) $fetch : the name of what you want (default 'name') For example: getCountryFormat(840, 'numcode', 'name') returns "United States". The countries are listed in the database table CubeCart_geo_country, and the states are listed in the database table CubeCart_geo_zone. Link to comment Share on other sites More sharing options...
glynwilliams Posted March 28, 2021 Author Share Posted March 28, 2021 Bsmither You're a lovely man. Thanks for your help. Cheers Glyn. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.