Author Topic: 2 digit code of State/Province/Region is shown instead of the name  (Read 19632 times)

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
In customer email and last step of checkout 2 digit code of State/Province/Region is shown instead of the name.

Example, for "Asturias" a Province in Spain, it show "33" instead of "Asturias".


mbit

  • Jr. Member
  • **
  • Posts: 323
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #1 on: November 05, 2010, 11:47:05 am »
i have the same issue but still no solution :/
http://forum.virtuemart.net/index.php?topic=77017.0

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #2 on: November 06, 2010, 14:55:25 pm »
This is by design. It is the accepted short form of the state / province / region. I understand that someone would like to customize it, but there is nothing to "fix" in the code.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #3 on: November 06, 2010, 17:01:20 pm »
Francesco,is not short form of the state but 2 digit number, how is one suppose to know what 33 means?

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #4 on: November 06, 2010, 19:29:18 pm »
It is like a "plate" number. What i mean is, it is not a "Table ID". If you look at the jos_vm_state table, you'll see these fields:

state_id - country_id - state_name - state_3_code - state_2_code

e.g.

1 - 223 - Alabama - ALA - AL

For "Asturias", if you look at the table, it reports

326 - 195 - Asturias - AST - 33

So maybe someone in Spain DOES know that 33 stands for "Asturias".  In Italy, if you write "BS" in an address, everyone knows it stands for "Brescia" province. Now, if data are wrong in the table, that's another matter.

Anyway, this can surely be discussed from an "usability" point of view, but it is definitely NOT a bug, so it won't be "fixed" in 1.1.x. Short time, 1.5 coming, blablabla... i hope you'll understand.

BTW, thank you again and again for your huge testing work.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #5 on: November 08, 2010, 09:51:24 am »
This is by design. It is the accepted short form of the state / province / region. I understand that someone would like to customize it, but there is nothing to "fix" in the code.
if there is nothing to fix , is there a way to show the state_name instead of state_id?

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #6 on: November 08, 2010, 13:32:46 pm »
Well, yes, and it is quite easy. You go to "Configuration" -> "Store" -> "Edit store" and modify your "Store" address format. This will be applied to your customer address format also.

OR, as an alternative, you edit templates/checkout/get_final_confirmation.tpl.php, assigning state_name value to state variable.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #7 on: November 08, 2010, 13:43:35 pm »
Well, yes, and it is quite easy. You go to "Configuration" -> "Store" -> "Edit store" and modify your "Store" address format. This will be applied to your customer address format also.
i have :
{storename}
{address_1}
{city}, {zip}
{phone} but i think this is for the address of my  store that is shown in the confirmation mail, it has nothing to do with the state_id that appears instead of the state_name of customer info.

OR, as an alternative, you edit templates/checkout/get_final_confirmation.tpl.php, assigning state_name value to state variable.
what should i edit here? this is for the last step before making the order?

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #8 on: March 01, 2011, 13:36:05 pm »
/components/com_virtuemart/themes/Your template/templates/checkout/customer_info.tpl.php

Around line 55:

$db->p("state_2_code");

Change it to:

$db->p("state_name");

There are more places to change the code but don't know them, this will solve it just for the checkout.

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #9 on: April 01, 2011, 10:26:10 am »
btw I don't know from where are you but neither in Italy or Spain they use those number codes, we write the full name of the state.

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #10 on: April 01, 2011, 15:43:03 pm »
I posted all the places this needs to be changed.
It is an annoying bug, have a look at the UK ones, nobody refers to wales as WS and would you know the SD is Scotland?

I should be a setting so you can decide, two letter codes only work in some places, USA being one I can think of.

It it is not a bug it should be a feature request then
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #11 on: April 01, 2011, 18:53:24 pm »
The only code with common sense to have numbers is the zip code, no matter if you are in the USA or Europe.

Asturias should be Asturias and not 33 and Scotland should be Scotland and not SD.

EDIT= I just realised this is VM 1.1 discussion forum and I'm using VM 1.1.8 and have the same problem with states :o

sgomezp

  • Beginner
  • *
  • Posts: 2
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #12 on: October 04, 2011, 12:04:10 pm »
I posted all the places this needs to be changed....


Please, could you tell me where do you posted that list ?
Thanks

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #13 on: October 04, 2011, 23:16:32 pm »
Search is your friend, I posted about it. and I have just found another location I missed.
I can't remember the post number.

This is a US centric look on the world where everyone (nearly) knows the US state codes, but fails nearly everywhere else in the world.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: 2 digit code of State/Province/Region is shown instead of the name
« Reply #14 on: October 05, 2011, 02:05:55 am »
I did search the same day you posted that and I can't find where you wrote all that info, we still have those "USA" codes in our spanish shop, our transport company love them ;)