VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: aravot on October 13, 2010, 08:41:30 am

Title: 2 digit code of State/Province/Region is shown instead of the name
Post by: aravot on October 13, 2010, 08:41:30 am
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".

(http://www.protechsystems.us/stuff/joomla/vm/vm-state_2_digit.png)
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: mbit 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
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: zanardi 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: aravot 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?
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: zanardi 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: mbit 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?
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: zanardi 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: mbit 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?
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: lindapowers 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: lindapowers 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: stinga 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
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: lindapowers 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
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: sgomezp 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
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: stinga 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.
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: lindapowers 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 ;)
Title: Re: 2 digit code of State/Province/Region is shown instead of the name
Post by: stinga on October 05, 2011, 20:24:33 pm
try this,
http://forum.virtuemart.net/index.php?topic=77017.msg258047#msg258047
It gives you an idea of what needs to be changed. I don't know where my original post went, or maybe I dreamt that I posted about it!