Print Page | Close Window

State Codes

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1640
Printed Date: 01-July-2024 at 5:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: State Codes
Posted By: Justplaying
Subject: State Codes
Date Posted: 20-May-2008 at 9:06am
On the default ProductCart, when a customer enters his/her details on the login form only the first 4 characters of the State are saved
We are based in the UK although we dont have states we do have counties
e.g.
North Yorkshire
Northhampton
Northumberland

Therefore when we come to print out the Invoice we only get 'Nort' ~ the first 4 characters

I have setup the state codes/statename/country to show the full information
Northumberland            Northumberland      UK

I have altered the dbo.states table in our sql database to allow 40 characters for the StateCode  nvarchar(40)

I have also modified dbo.orders and dbo.customers to allow the StateCode 40 characters and the shipping state code 40 characters

But when a customers processes an order the first 4 characters of the state code are only saved

I am obviously missing something but what?  Cry

Please can anyone help

Thanks

Neil



Replies:
Posted By: Hamish
Date Posted: 20-May-2008 at 10:14am
Hi Neil,
  We are UK based as well, but chose to NOT use the state codes as the UK doesn't really use that concept, just county names, which is different.  We are operating without any problems.
 I suspect your heading into potentially risky waters here.

UK users - Do any of you have direct experience of implementing this ?

Anyway, what I found :

From the PC V3.11 manual :-
"When there are no states or provinces associated with a country, the State/Province field
becomes an input field, and is not required. Since an input field can lead to user errors,
whenever possible we recommend that you enter the states/provinces associated with
your default country (and the countries your customers most commonly purchase from)."

Despite the last "whenever" sentence....

Looking for "statecode" in the asp source files reveals huge numbers of references  (151 files with the string statecode). I'm sure many/most of the files would not need amending, but it would be best to check them all.
Many of the payment gateway files appears in the list, which I would be very cautious about amending without reference to the  interface documentation for the specific payment gateway that you use, and stringent testing after any changes.

- For example, even what I assume is a UK specific piece of code (pcPay_ExpressPayUK_Start.asp) contains:-

        if len(pcv_StateCode)>4 then
            pcv_StateCode="" '// Show Province Field, This is not a valid ISO Code
        end if

Similar restrictions seem to apply to Google checkout.

This was a VERY QUICK look - It may well be that other UK users have implemented  "state codes"  for counties already.

HTH
  Hamish


Posted By: Justplaying
Date Posted: 20-May-2008 at 10:48am

Hi Hamish

Thanks for getting back to me but you lost me in your first paragraph
 
We are UK based as well, but chose to NOT use the state codes as the UK doesn't really use that concept, just county names, which is different.
 
I realise we have counties in this country but they are a similar concept
County - A territorial division exercising administrative, judicial, and political functions in Great Britain and Ireland.
State - the territory, or one of the territories, of a government.
 
I guess the only reason ProductCart uses States/Provenices is because it isnt produced in the UK
 
But more to the point how have you applied your county names like yorkshire or greater manchester if you havent used the MANAGE STATES PAGE in ProductCart Admin
 
And if you have used the manage states page, each entry requires a code which in turn is then printed on the invoice and delivery note
 
I realise I could delete all the counties we have applied to the UK, this would allow the customer to input it themselves
 
But I also realise this could cause typo mistakes
 
 
 


Posted By: Hamish
Date Posted: 20-May-2008 at 11:21am
Hi,
   Yes, Typo's are always a risk - but no more than the rest of the address &  the key to delivery in the UK is the post code & house number/name.
Lack of "state codes" has never caused us the slightest problem.

We have not added any UK counties on the "manage states" page. The client's just type it in when they register, just like the rest of their address.
The address comes out OK on invoice & delivery notes, although we do make minor changes to get the UK style layout, but strictly speaking that's not necessary.

I took a look at another UK based PC website - http://www.wovenwheatwhispers.co.uk - www.wovenwheatwhispers.co.uk
and they also do not use the "state codes" either.

It would be great if someone who HAS either implemented or attempted to implement this in the UK joined the discussion, so there was a definitive answer on this.



Posted By: Hamish
Date Posted: 20-May-2008 at 11:26am
The main reason for the state code to be in a defined list is that, as far as I know, the state code is the first part of the ZIP code - Like we use GU for Guildford in our post codes, so it's crucial that it is correct, which is not the case for our county/area names, which are independent of the post codes. 


Posted By: Matt
Date Posted: 20-May-2008 at 11:44am

When you create a state via “Manage States” you must enter a Full Name (which is displayed to the customer in a drop menu) and a 2-4 character ISO Code (which is saved to the database).  The ISO state code should be 4 digits or less.  Some services, such as PayPal, require a valid ISO code in reference to an address.  In such cases, the full name of a region is not acceptable (as it could be misspelled).

If using ISO Codes does not fit your needs then you should not add custom states for your country.  If there are no custom states ProductCart will display a text field for the customer to type the name of their region.  They can type more than 4 characters in a text field.

If you believe your install is not working as I have explained please let us know.



Posted By: Hamish
Date Posted: 20-May-2008 at 12:43pm
Hi Matt,
   That pretty much confirms my thoughts then.  I think the "State Codes" is a bust for UK format addresses.

Thanks for the input.  Have there been any thoughts on having country specific sections on the forum?  There are several UK users present that I'm aware of & this type of question would fit better in a country specific section as well as encoraging, say, UK members to subscribe & keep in touch over issues specific to their country - such as:
- Postal & Shipping issues.
- VAT
- Payment Gateways (some).

Hamish




Posted By: Justplaying
Date Posted: 20-May-2008 at 2:30pm
Originally posted by Matt Matt wrote:

When you create a state via “Manage States” you must enter a Full Name (which is displayed to the customer in a drop menu) and a 2-4 character ISO Code (which is saved to the database).  The ISO state code should be 4 digits or less.  Some services, such as PayPal, require a valid ISO code in reference to an address.  In such cases, the full name of a region is not acceptable (as it could be misspelled).

If using ISO Codes does not fit your needs then you should not add custom states for your country.  If there are no custom states ProductCart will display a text field for the customer to type the name of their region.  They can type more than 4 characters in a text field.

If you believe your install is not working as I have explained please let us know.



No our install is working fine,  In fact we used Cartweaver for 2 years prior to switching to ProductCart last Summer and our sales have more than trebled

I was just trying to find a way of using the full county names which have been setup in Admin other than customer input

Also for UK use is it possible to edit the State/Province title on the login form
Billing address

First Name:
Last Name:
Company:
Country:
Address:
City:
State/Province:  > County
Postal Code:
Phone:
Fax:

I have tried but cant figure out how to change the title to Counties but cant figure out where the page pulls the headings from Confused

Actually is it possible?

Thanks

Neil


Posted By: Matt
Date Posted: 20-May-2008 at 2:31pm

Can you enter the ISO Code "NBL" for " http://en.wikipedia.org/wiki/Northumberland - Northumberland "?

If so, then you can definitely use the state drop down in the UK.



Posted By: Matt
Date Posted: 20-May-2008 at 2:34pm
look for "CustAddModShip_19" and "CustAddModShip_6" and "CustAddModShip_5" inside "includes/languages.asp" to change the text.


Posted By: Hamish
Date Posted: 20-May-2008 at 4:21pm
Matt,
   Is there an ISO list of codes for UK Counties?  I googled for it but did not find anything.

I suspect even if there is - The codes are not used in UK addresses - so customers would not know which code to select - or does it show the full "state" in the drop down?

Neil - includes/languages.asp is your friend Big%20smile - If you ever want to change text on a page - look in there!

Hamish


Posted By: Matt
Date Posted: 20-May-2008 at 4:37pm
The customer sees the fullname.
 
http://en.wikipedia.org/wiki/ISO_3166-2:GB - http://en.wikipedia.org/wiki/ISO_3166-2:GB
 
You would not add the prefix "GB-" when you save the regions.


Posted By: Justplaying
Date Posted: 20-May-2008 at 4:57pm
Thanks for that, all changed and looks positively British now LOL




Posted By: Hamish
Date Posted: 20-May-2008 at 5:16pm
Thanks Matt.  Thumbs%20Up
Justplaying - Implemented already - cool!

I'm going to implement a subset of these for a client who just delivers to a limited geographical area. 





Posted By: Hamish
Date Posted: 21-May-2008 at 4:25am
Things just got a bit confused again.
I noticed that the ISO is a list of administrative areas of the UK and NOT postal areas.

For example, Bracknell Forest is never used in addresses and Middlesex was missing, which, although no longer a county is still used in postal addresses :-

<snip>
Middlesex is still used informally as an area name and was retained as a http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom - postal county ; which is now an optional component of postal addresses
</snip>

The KEY item there is optional component of postal addresses. Investigating further led me to :-

  http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom - http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom

<snip>
The Royal Mail has ceased to use the postal counties as a means of sorting mail following the modernisation of their http://en.wikipedia.org/wiki/Optical_character_recognition - optical character recognition equipment in 1996. Instead, using postcode defined circulation, the outward code (first half) of the post code is used to differentiate between like-sounding post towns. The former postal county (as they are now known) for each post town as it was in 1996 is still held on record by the Royal Mail but where new post towns are created they will not be assigned to a former postal county. Where it is possible, and it is proven there is demand, Royal Mail will consider changes to their address data. Under their code, however, changes to county data will not be considered
</snip>
 
Yet more digging leads to http://en.wikipedia.org/wiki/Post_town - http://en.wikipedia.org/wiki/Post_town   "A post town is a required part of all postal addresses in the United Kingdom" and a link to a list of the UK postal towns - http://www.evoxfacilities.co.uk/evoxptn.html - http://www.evoxfacilities.co.uk/evoxptn.html
The royal mail, being the  short sighted leviathan that it is, maintain the definitive list of Postal Towns - but you have to buy it.

Where does that leave us?
Back at the beginning I'm afraid - The ISO list does not cross reference with the postal counties, which have always been different & is now officially defunct.
The list of postal towns is both huge & does not have assigned 2-4 character codes.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net