user3141 From Unknown Member since Dec -0001 user3141 May 9 2017 01:55 AM Please could you assist I have encountered this Invalid postcode format. How do i get this sorted i am using 2.X version
tim Founder From Sweden Member since May 2013 tim May 9 2017 01:59 AM Admin -> Countries -> Edit Country -> Postcode Format Leave field empty for no validating of postcode.
user3141 From Unknown Member since Dec -0001 user3141 May 9 2017 01:59 AM Customer Details: Invalid postcode format. this is what i am having I tried all options but its not working
user3141 From Unknown Member since Dec -0001 user3141 May 9 2017 02:10 AM Thanks Its now working fine
tim Founder From Sweden Member since May 2013 tim May 9 2017 03:02 AM Are the postcode formats that comes with the platform no good? Please provide an example if there is something to fix/improve?
user3141 From Unknown Member since Dec -0001 user3141 May 9 2017 12:31 PM Tim I am trying to work out how best to get this fixed
tim Founder From Sweden Member since May 2013 tim May 9 2017 05:02 PM That's okay. Let me know if any postcode format needs fixing. All you need to provide is a valid postcode and country that was denied by LiteCart. I will find the solution for you.
user3141 From Unknown Member since Dec -0001 user3141 May 9 2017 11:44 PM L5 8SF was declined by the system and a couple more where denied by the system
tim Founder From Sweden Member since May 2013 tim May 11 2017 03:13 AM Accoarding to http://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive there is a regex code supplied by the UK Government: (GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKPSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2}) "L5 8SF" does not validate This is the code LiteCart uses: GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)([0-9][[0-9]A-Z]?[ ]?[0-9][ABD-HJLN-UW-Z]{2}))|BFPO[ ]?[0-9]{1,4} "L5 8SF" does not validate It did not even validate with this supplied by appspotr, or my regex parser is broken: GIR ?0AA|(?:(?:AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|BX|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(?:\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}))|BFPO ?\\d{1,4} Until a better code shows up you can use **.*** to allow any set of characters.
user4147 Merchant From United Kingdom Member since May 2017 user4147 May 19 2017 11:30 PM it seems the UK regex is flawed, LA1 5PE does not validate with or without the space.
tim Founder From Sweden Member since May 2013 tim May 20 2017 03:55 PM How about something universal like [A-Z]{1,2}[0-9][0-9A-Z]? ?[0-9][A-Z]{2} Otherwise just go with anything provided .*
user4147 Merchant From United Kingdom Member since May 2017 user4147 May 20 2017 04:27 PM That one works on both of the postcodes posted here L5 8SF and LA1 5PE with and without space. Thank you.