Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add states to the United Kingdom localization pack #19430

Open
Tracked by #17564
Gionny996 opened this issue May 27, 2020 · 10 comments · May be fixed by PrestaShop/LocalizationFiles#13
Open
Tracked by #17564

Add states to the United Kingdom localization pack #19430

Gionny996 opened this issue May 27, 2020 · 10 comments · May be fixed by PrestaShop/LocalizationFiles#13
Labels
8.1.x Branch BO Category: Back Office Bug Type: Bug Good first issue Community: beginner-friendly issues Hacktoberfest Identify Hacktoberfest contributions International Component: Which BO section is concerned Localization Label: Which BO under menu is concerned PR available Solution: issue is being addressed Ready Status: Issue is ready to be worked on States Label: Which BO under menu is concerned

Comments

@Gionny996
Copy link

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to 'International'
  2. Click on 'Localization'
  3. Select United Kingdom in "Localization pack you want to import"
  4. Import States
  5. Go to 'location>states'
  6. Nothing States for United Kingdom

Screenshots: https://prnt.sc/sovu00

  • PrestaShop version: 1.7.6.1
  • PHP version: 7.3.18
@prestashop-issue-bot
Copy link

Thanks for opening this issue! We will help you to keep its state consistent

@florine2623
Copy link
Contributor

Hi @Gionny996 ,
First, please downgrade to PHP 7.2. Here's the compatibility chart of PrestaShop :
https://devdocs.prestashop.com/1.7/basics/installation/system-requirements/

Second, in the xml file for the UK, there aren't any states available.
You can check that in /localization/gb.xml
You can add them manually for now.
Thanks!

@florine2623
Copy link
Contributor

florine2623 commented May 28, 2020

Hi @PrestaShop/prestashop-product-team ,

Do you think it is possible to add the states for the UK in PS ?
@Gionny996 's issue is present on PS 1.7.6.5 and PS 1.7.7 beta.

Thanks!

@florine2623 florine2623 added BO Category: Back Office Improvement Type: Improvement International Component: Which BO section is concerned Localization Label: Which BO under menu is concerned NMI Status: issue needs more information Waiting for PM Status: action required, waiting for product feedback labels May 28, 2020
@MatShir
Copy link
Contributor

MatShir commented May 28, 2020

@LouiseBonnard should we add it to this epic - #17564 ?

@LouiseBonnard
Copy link
Contributor

Hi @Gionny996 and @MatShir, yep, you can only add them manually in the back office. By default, states are added to the code only for countries whose address format requires states for deliveries. Like for India, cf. #15627.

It does not seem to be the case for Great Britain so we probably won't do it on our end but if you ever feel like improving this section, do not hesitate to create a pull request to contribute. :-)

@LouiseBonnard LouiseBonnard added Good first issue Community: beginner-friendly issues States Label: Which BO under menu is concerned Ready Status: Issue is ready to be worked on and removed NMI Status: issue needs more information Waiting for PM Status: action required, waiting for product feedback labels May 28, 2020
@LouiseBonnard LouiseBonnard changed the title United Kindom States Add states to the United Kingdom localization pack Jun 11, 2020
@HartLarsson
Copy link

HartLarsson commented Aug 6, 2020

inside gb.xml is missing completely the part:

<states>
<state name="Buckinghamshire" iso_code="GB-BKM" country="GB" zone="Europe"/>
....
</states>

so is not possible to import them like you can do for Italy or USA.

i've made a CSV with ISO code ,name of the "state", Subdivision category and Parent subdivision

GB-BKM,Buckinghamshire,two-tier county,ENG
GB-CAM,Cambridgeshire,two-tier county,ENG
GB-CMA,Cumbria,two-tier county,ENG
GB-DBY,Derbyshire,two-tier county,ENG
GB-DEV,Devon,two-tier county,ENG
GB-DOR,Dorset,two-tier county,ENG
GB-ESX,East Sussex,two-tier county,ENG
GB-ESS,Essex,two-tier county,ENG
GB-GLS,Gloucestershire,two-tier county,ENG
GB-HAM,Hampshire,two-tier county,ENG
GB-HRT,Hertfordshire,two-tier county,ENG
GB-KEN,Kent,two-tier county,ENG
GB-LAN,Lancashire,two-tier county,ENG
GB-LEC,Leicestershire,two-tier county,ENG
GB-LIN,Lincolnshire,two-tier county,ENG
GB-NFK,Norfolk,two-tier county,ENG
GB-NYK,North Yorkshire,two-tier county,ENG
GB-NTH,Northamptonshire,two-tier county,ENG
GB-NTT,Nottinghamshire,two-tier county,ENG
GB-OXF,Oxfordshire,two-tier county,ENG
GB-SOM,Somerset,two-tier county,ENG
GB-STS,Staffordshire,two-tier county,ENG
GB-SFK,Suffolk,two-tier county,ENG
GB-SRY,Surrey,two-tier county,ENG
GB-WAR,Warwickshire,two-tier county,ENG
GB-WSX,West Sussex,two-tier county,ENG
GB-WOR,Worcestershire,two-tier county,ENG
GB-LND,London, City of,city corporation,ENG
GB-BDG,Barking and Dagenham,London borough,ENG
GB-BNE,Barnet,London borough,ENG
GB-BEX,Bexley,London borough,ENG
GB-BEN,Brent,London borough,ENG
GB-BRY,Bromley,London borough,ENG
GB-CMD,Camden,London borough,ENG
GB-CRY,Croydon,London borough,ENG
GB-EAL,Ealing,London borough,ENG
GB-ENF,Enfield,London borough,ENG
GB-GRE,Greenwich,London borough,ENG
GB-HCK,Hackney,London borough,ENG
GB-HMF,Hammersmith and Fulham,London borough,ENG
GB-HRY,Haringey,London borough,ENG
GB-HRW,Harrow,London borough,ENG
GB-HAV,Havering,London borough,ENG
GB-HIL,Hillingdon,London borough,ENG
GB-HNS,Hounslow,London borough,ENG
GB-ISL,Islington,London borough,ENG
GB-KEC,Kensington and Chelsea,London borough,ENG
GB-KTT,Kingston upon Thames,London borough,ENG
GB-LBH,Lambeth,London borough,ENG
GB-LEW,Lewisham,London borough,ENG
GB-MRT,Merton,London borough,ENG
GB-NWM,Newham,London borough,ENG
GB-RDB,Redbridge,London borough,ENG
GB-RIC,Richmond upon Thames,London borough,ENG
GB-SWK,Southwark,London borough,ENG
GB-STN,Sutton,London borough,ENG
GB-TWH,Tower Hamlets,London borough,ENG
GB-WFT,Waltham Forest,London borough,ENG
GB-WND,Wandsworth,London borough,ENG
GB-WSM,Westminster,London borough,ENG
GB-BNS,Barnsley,metropolitan district,ENG
GB-BIR,Birmingham,metropolitan district,ENG
GB-BOL,Bolton,metropolitan district,ENG
GB-BRD,Bradford,metropolitan district,ENG
GB-BUR,Bury,metropolitan district,ENG
GB-CLD,Calderdale,metropolitan district,ENG
GB-COV,Coventry,metropolitan district,ENG
GB-DNC,Doncaster,metropolitan district,ENG
GB-DUD,Dudley,metropolitan district,ENG
GB-GAT,Gateshead,metropolitan district,ENG
GB-KIR,Kirklees,metropolitan district,ENG
GB-KWL,Knowsley,metropolitan district,ENG
GB-LDS,Leeds,metropolitan district,ENG
GB-LIV,Liverpool,metropolitan district,ENG
GB-MAN,Manchester,metropolitan district,ENG
GB-NET,Newcastle upon Tyne,metropolitan district,ENG
GB-NTY,North Tyneside,metropolitan district,ENG
GB-OLD,Oldham,metropolitan district,ENG
GB-RCH,Rochdale,metropolitan district,ENG
GB-ROT,Rotherham,metropolitan district,ENG
GB-SHN,St. Helens,metropolitan district,ENG
GB-SLF,Salford,metropolitan district,ENG
GB-SAW,Sandwell,metropolitan district,ENG
GB-SFT,Sefton,metropolitan district,ENG
GB-SHF,Sheffield,metropolitan district,ENG
GB-SOL,Solihull,metropolitan district,ENG
GB-STY,South Tyneside,metropolitan district,ENG
GB-SKP,Stockport,metropolitan district,ENG
GB-SND,Sunderland,metropolitan district,ENG
GB-TAM,Tameside,metropolitan district,ENG
GB-TRF,Trafford,metropolitan district,ENG
GB-WKF,Wakefield,metropolitan district,ENG
GB-WLL,Walsall,metropolitan district,ENG
GB-WGN,Wigan,metropolitan district,ENG
GB-WRL,Wirral,metropolitan district,ENG
GB-WLV,Wolverhampton,metropolitan district,ENG
GB-BAS,Bath and North East Somerset,unitary authority,ENG
GB-BDF,Bedford,unitary authority,ENG
GB-BBD,Blackburn with Darwen,unitary authority,ENG
GB-BPL,Blackpool,unitary authority,ENG
GB-BMH,Bournemouth,unitary authority,ENG
GB-BRC,Bracknell Forest,unitary authority,ENG
GB-BNH,Brighton and Hove,unitary authority,ENG
GB-BST,Bristol, City of,unitary authority,ENG
GB-CBF,Central Bedfordshire,unitary authority,ENG
GB-CHE,Cheshire East,unitary authority,ENG
GB-CHW,Cheshire West and Chester,unitary authority,ENG
GB-CON,Cornwall,unitary authority,ENG
GB-DAL,Darlington,unitary authority,ENG
GB-DER,Derby,unitary authority,ENG
GB-DUR,Durham County,unitary authority,ENG
GB-ERY,East Riding of Yorkshire,unitary authority,ENG
GB-HAL,Halton,unitary authority,ENG
GB-HPL,Hartlepool,unitary authority,ENG
GB-HEF,Herefordshire,unitary authority,ENG
GB-IOW,Isle of Wight,unitary authority,ENG
GB-IOS,Isles of Scilly,unitary authority,ENG
GB-KHL,Kingston upon Hull,unitary authority,ENG
GB-LCE,Leicester,unitary authority,ENG
GB-LUT,Luton,unitary authority,ENG
GB-MDW,Medway,unitary authority,ENG
GB-MDB,Middlesbrough,unitary authority,ENG
GB-MIK,Milton Keynes,unitary authority,ENG
GB-NEL,North East Lincolnshire,unitary authority,ENG
GB-NLN,North Lincolnshire,unitary authority,ENG
GB-NSM,North Somerset,unitary authority,ENG
GB-NBL,Northumberland,unitary authority,ENG
GB-NGM,Nottingham,unitary authority,ENG
GB-PTE,Peterborough,unitary authority,ENG
GB-PLY,Plymouth,unitary authority,ENG
GB-POL,Poole,unitary authority,ENG
GB-POR,Portsmouth,unitary authority,ENG
GB-RDG,Reading,unitary authority,ENG
GB-RCC,Redcar and Cleveland,unitary authority,ENG
GB-RUT,Rutland,unitary authority,ENG
GB-SHR,Shropshire,unitary authority,ENG
GB-SLG,Slough,unitary authority,ENG
GB-SGC,South Gloucestershire,unitary authority,ENG
GB-STH,Southampton,unitary authority,ENG
GB-SOS,Southend-on-Sea,unitary authority,ENG
GB-STT,Stockton-on-Tees,unitary authority,ENG
GB-STE,Stoke-on-Trent,unitary authority,ENG
GB-SWD,Swindon,unitary authority,ENG
GB-TFW,Telford and Wrekin,unitary authority,ENG
GB-THR,Thurrock,unitary authority,ENG
GB-TOB,Torbay,unitary authority,ENG
GB-WRT,Warrington,unitary authority,ENG
GB-WBK,West Berkshire,unitary authority,ENG
GB-WIL,Wiltshire,unitary authority,ENG
GB-WNM,Windsor and Maidenhead,unitary authority,ENG
GB-WOK,Wokingham,unitary authority,ENG
GB-YOR,York,unitary authority,ENG
GB-ANN,Antrim and Newtownabbey,district,NIR
GB-AND,Ards and North Down,district,NIR
GB-ABC,Armagh City, Banbridge and Craigavon,district,NIR
GB-BFS,Belfast,district,NIR
GB-CCG,Causeway Coast and Glens,district,NIR
GB-DRS,Derry City and Strabane,district,NIR
GB-FMO,Fermanagh and Omagh,district,NIR
GB-LBC,Lisburn and Castlereagh,district,NIR
GB-MEA,Mid and East Antrim,district,NIR
GB-MUL,Mid Ulster,district,NIR
GB-NMD,Newry, Mourne and Down,district,NIR
GB-ABE,Aberdeen City,council area,SCT
GB-ABD,Aberdeenshire,council area,SCT
GB-ANS,Angus,council area,SCT
GB-AGB,Argyll and Bute,council area,SCT
GB-CLK,Clackmannanshire,council area,SCT
GB-DGY,Dumfries and Galloway,council area,SCT
GB-DND,Dundee City,council area,SCT
GB-EAY,East Ayrshire,council area,SCT
GB-EDU,East Dunbartonshire,council area,SCT
GB-ELN,East Lothian,council area,SCT
GB-ERW,East Renfrewshire,council area,SCT
GB-EDH,Edinburgh, City of,council area,SCT
GB-ELS,Eilean Siar,council area,SCT
GB-FAL,Falkirk,council area,SCT
GB-FIF,Fife,council area,SCT
GB-GLG,Glasgow City,council area,SCT
GB-HLD,Highland,council area,SCT
GB-IVC,Inverclyde,council area,SCT
GB-MLN,Midlothian,council area,SCT
GB-MRY,Moray,council area,SCT
GB-NAY,North Ayrshire,council area,SCT
GB-NLK,North Lanarkshire,council area,SCT
GB-ORK,Orkney Islands,council area,SCT
GB-PKN,Perth and Kinross,council area,SCT
GB-RFW,Renfrewshire,council area,SCT
GB-SCB,Scottish Borders, The,council area,SCT
GB-ZET,Shetland Islands,council area,SCT
GB-SAY,South Ayrshire,council area,SCT
GB-SLK,South Lanarkshire,council area,SCT
GB-STG,Stirling,council area,SCT
GB-WDU,West Dunbartonshire,council area,SCT
GB-WLN,West Lothian,council area,SCT
GB-BGW,Blaenau Gwent,unitary authority,WLS
GB-BGE,Bridgend,unitary authority,WLS
GB-CAY,Caerphilly,unitary authority,WLS
GB-CRF,Cardiff,unitary authority,WLS
GB-CMN,Carmarthenshire,unitary authority,WLS
GB-CGN,Ceredigion,unitary authority,WLS
GB-CWY,Conwy,unitary authority,WLS
GB-DEN,Denbighshire,unitary authority,WLS
GB-FLN,Flintshire,unitary authority,WLS
GB-GWN,Gwynedd,unitary authority,WLS
GB-AGY,Isle of Anglesey,unitary authority,WLS
GB-MTY,Merthyr Tydfil,unitary authority,WLS
GB-MON,Monmouthshire,unitary authority,WLS
GB-NTL,Neath Port Talbot,unitary authority,WLS
GB-NWP,Newport,unitary authority,WLS
GB-PEM,Pembrokeshire,unitary authority,WLS
GB-POW,Powys,unitary authority,WLS
GB-RCT,Rhondda, Cynon, Taff,unitary authority,WLS
GB-SWA,Swansea,unitary authority,WLS
GB-TOF,Torfaen,unitary authority,WLS
GB-VGL,Vale of Glamorgan, The,unitary authority,WLS
GB-WRX,Wrexham,unitary authority,WLS

More info here: https://en.wikipedia.org/wiki/ISO_3166-2:GB

So if someone want to add in the righjt format inside3 the xml all peole will be able to import in the correct way

@HartLarsson
Copy link

Hi @Gionny996 and @MatShir, yep, you can only add them manually in the back office. By default, states are added to the code only for countries whose address format requires states for deliveries. Like for India, cf. #15627.

It does not seem to be the case for Great Britain so we probably won't do it on our end but if you ever feel like improving this section, do not hesitate to create a pull request to contribute. :-)

UK have very different price for delivery from the mainland to island and north ireland or scotland. So all selelrs that need to sell in GB need to implemant manually the "states". Same for Portugal that has many island at shipping price that soemtime sis twice of the normal.

@jem-here
Copy link

jem-here commented Dec 7, 2020

I have tried to add the counties and remove UK from EU in this gb.xml. The import works for 1.7.7.0 I would like to automate the inclusion of states (counties in UK speak) to produce a drop down list for customer sign ups as per USA for instance. I have added the tax rules for UK in same way as USA but not sure it's needed or even if the order and numbering is relevant. I'd ultimately like to make the shipping dependant on the country not zone too if that can be automated?

Hopefully a start for someone who actually understands what's needed!

Jem

gb.zip

@jem-here
Copy link

jem-here commented Dec 8, 2020

I have noticed that on my file import when a state (county) iso code exists in another country the tax rule appears to be allocated to that iso code eg cam uk goes to Campeche in Mexico. Do I need to reorder the file or is it a bug country and state are not filtered on import? I also think the zone should be a custom zone to help postage allocation to within UK or outside UK not Europe (non-EU) even if that were correct in fact

@rickygzz
Copy link
Contributor

Hello,

I believe we will have to split this issue fix in at least two pull requests: one to add the states, and another to add the tax rules.

So I created the first pull request for this issue in PrestaShop/LocalizationFiles#13

The added states are based on ISO 3166-2 (https://www.iso.org/obp/ui/#iso:code:3166:GB) which has the latest changes up to November 25, 2021.

It seems the suggested "states" by HartLarsson (I believe he was based on Wikipedia) are a little bit outdated.

For example,
These were deleted/removed from ISO 3166-2 (but suggested by HartLarsson)

  • Antrim and Newtownabbey "ANN"
  • Armagh "ARM"
  • Avon "AVN"
  • Banffshire "BAN"
  • ...

Added to ISO 3166-2 (not in HartLarsson suggestions)

  • Armagh, Banbridge and Craigavon "ABC"
  • Barnsley BNS
  • Bath and North East Somerset BAS
  • Belfast City "BFS"
  • Birmingham "BIR"
  • Blackburn with Darwen "BBD"
  • Blackpool "BPL"
  • ...

etc, etc, etc.

I believe there are no states in the United Kingdom, but they have divisions (countries England, Scotland and Wales) and subdivisions (boroughs, cities, counties and districts). I am not from UK, but I added "states" based on the ISO 3166-2 (https://www.iso.org/obp/ui/#iso:code:3166:GB) which has the latest changes up to November 25, 2021. I added divisions (countries) and subdivisions as if they were states.

I would appreciate, if possible, either HartLarsson or any UK native to check the changes in PR PrestaShop/LocalizationFiles#13

@marionf marionf added Bug Type: Bug and removed Improvement Type: Improvement labels Dec 28, 2021
@Progi1984 Progi1984 added the PR available Solution: issue is being addressed label Sep 23, 2022
@MatShir MatShir added the Hacktoberfest Identify Hacktoberfest contributions label Sep 21, 2023
@hibatallahAouadni hibatallahAouadni added the 8.1.x Branch label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.1.x Branch BO Category: Back Office Bug Type: Bug Good first issue Community: beginner-friendly issues Hacktoberfest Identify Hacktoberfest contributions International Component: Which BO section is concerned Localization Label: Which BO under menu is concerned PR available Solution: issue is being addressed Ready Status: Issue is ready to be worked on States Label: Which BO under menu is concerned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants