News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

2 digit code of State/Province/Region is shown instead of the name

Started by aravot, October 13, 2010, 08:41:30 AM

Previous topic - Next topic

aravot

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".



zanardi

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


zanardi

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

Quote from: 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.
if there is nothing to fix , is there a way to show the state_name instead of state_id?

zanardi

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

Quote from: 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.
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.

Quote from: zanardi on November 08, 2010, 13:32:46 PMOR, 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

/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

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

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

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

Quote from: stinga on April 01, 2011, 15:43:03 PM
I posted all the places this needs to be changed....


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

stinga

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

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 ;)