US Zip Code Formats NNNNN(-NNNN) - Can Both Be Used?

Jump to content
  • Browse
    • Forums
    • Staff
    • Online Users
    • Leaderboard
    • Code of Conduct
    • More
  • Activity
    • All Activity
    • Search
    • More
  • Go back to prestashop.com
    • Project on GitHub
    • Build blog
    • Dev Docs
    • User Docs
    • User Club
    • Addons Marketplace
    • More
  • More
    • More
  • Everywhere
  • This Forum
  • This Topic
  • Topics
  • Members
  • Configuring and using PrestaShop
  • All Activity
  • Home
  • Community Help and Support
  • PrestaShop Download
  • Configuring and using PrestaShop
  • US Zip Code Formats NNNNN(-NNNN) - Can Both Be Used?
  • Hosting Performance Ebook Prestahop
  • Hosting Performance Ebook Prestahop
  • Hosting Performance Ebook Prestahop
US Zip Code Formats NNNNN(-NNNN) - Can Both Be Used?
  • zip code
  • countries
  • postal code
  • format
artofadornment Share More sharing options... Followers 0

Recommended Posts

artofadornment Newbie Posted May 12, 2013
  • artofadornment Newbie
  • Members
    • 102
    • Share
Posted May 12, 2013

Is there is a way to enable both USA zip code formats (5-digit and 9-digit) in PS 1.5.3.1?

 

In the Localization > Countries section in the BO I tried removing the default NNNNN ("No verification if undefined") for the USA hoping that might allow either format, but in testing this in the FO I got an error message telling me "Zip/Postal code is invalid. Must be typed as follows:" (and it was just blank after the "as follows:" text). So that didn't work. It is forcing me to use 5 digits regardless. And of course, changing it to NNNNN-NNNN forces you to use all 9 digits.

 

I tried to follow along with this post here but they lost me at "overrides", plus the code might not be the same in 1.5 anyway, so I have no idea how to even try that workaround. But from what I can tell, allowing a wildcard (NNNNN*) at least would be ideal, and for UK postal codes as well.

 

I'm not a developer so I need would some guidance for what files to change, and also what code I would need. Can anyone help with this?

 

Thanks in advance!

 

~ Elaine

Link to comment
Share on other sites
More sharing options...
  • 4 months later...
meccabooks Newbie Posted October 1, 2013
  • meccabooks Newbie
  • Members
    • 131
    • Share
Posted October 1, 2013

Is there is a way to enable both USA zip code formats (5-digit and 9-digit) in PS 1.5.3.1?

 

In the Localization > Countries section in the BO I tried removing the default NNNNN ("No verification if undefined") for the USA hoping that might allow either format, but in testing this in the FO I got an error message telling me "Zip/Postal code is invalid. Must be typed as follows:" (and it was just blank after the "as follows:" text). So that didn't work. It is forcing me to use 5 digits regardless. And of course, changing it to NNNNN-NNNN forces you to use all 9 digits.

 

I tried to follow along with this post here but they lost me at "overrides", plus the code might not be the same in 1.5 anyway, so I have no idea how to even try that workaround. But from what I can tell, allowing a wildcard (NNNNN*) at least would be ideal, and for UK postal codes as well.

 

I'm not a developer so I need would some guidance for what files to change, and also what code I would need. Can anyone help with this?

 

Thanks in advance!

 

~ Elaine

Any help in this regard.. customer buying from APO etc can't place order on my website as they are required to enter all 9 digits zipcode

Link to comment
Share on other sites
More sharing options... tuk66 Apprentice Posted October 1, 2013
  • tuk66 Apprentice
  • Members
    • 9.8k
    • Share
Posted October 1, 2013

In general, try to override the checkZipCode() function in the Country.php and/or the isZipCodeFormat() one in the Validate.php.

Link to comment
Share on other sites
More sharing options... meccabooks Newbie Posted October 7, 2013
  • meccabooks Newbie
  • Members
    • 131
    • Share
Posted October 7, 2013

In general, try to override the checkZipCode() function in the Country.php and/or the isZipCodeFormat() one in the Validate.php.

Can you please be little bit more detailed, I am not very familiar with the coding

Link to comment
Share on other sites
More sharing options... tuk66 Apprentice Posted October 8, 2013
  • tuk66 Apprentice
  • Members
    • 9.8k
    • Share
Posted October 8, 2013

Just an idea. One have to seriously code and debug desired functionality. It is not a case for forum.

Link to comment
Share on other sites
More sharing options...
  • 9 months later...
artofadornment Newbie Posted July 30, 2014
  • artofadornment Newbie
  • Members
    • 102
  • Author
    • Share
Posted July 30, 2014

Bumping my post...

There must be some way to enable both USA zip code formats (5-digit and 9-digit), in PS 1.5.3 or otherwise. Can anyone help?

Link to comment
Share on other sites
More sharing options...
  • 1 year later...
RabbitZzZ Apprentice Posted January 4, 2016
  • RabbitZzZ Apprentice
  • Members
    • 119
    • Share
Posted January 4, 2016

Sorry to bump this old thread, but is this somehow possible now in Prestashop 1.6?

Link to comment
Share on other sites
More sharing options... tuk66 Apprentice Posted January 5, 2016
  • tuk66 Apprentice
  • Members
    • 9.8k
    • Share
Posted January 5, 2016

Of course, improve some validation methods.

Link to comment
Share on other sites
More sharing options...
  • 11 months later...
dungeoncrawler Newbie Posted January 3, 2017
  • dungeoncrawler Newbie
  • Members
    • 28
    • Share
Posted January 3, 2017

I'm also looking for answer to this as now that I have deactivated the zip code requirement so that both codes can be used - people aren't entering the zip codes!

Link to comment
Share on other sites
More sharing options...
  • 6 months later...
dformica2 Newbie Posted July 27, 2017
  • dformica2 Newbie
  • Members
    • 18
    • Share
Posted July 27, 2017

Bumping this topic.

 

Is there away to enter 2 formats in the postal code to validate both:   NNNNN  OR  NNNNN-NNNN

Link to comment
Share on other sites
More sharing options... bellini13 Newbie Posted July 28, 2017
  • bellini13 Newbie
  • Members
    • 8.4k
    • Share
Posted July 28, 2017

There is not a way to do this currently, it has to be developed. 

Link to comment
Share on other sites
More sharing options...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now Share More sharing options... Followers 0 Go to topic listing
  • All Activity
  • Home
  • Community Help and Support
  • PrestaShop Download
  • Configuring and using PrestaShop
  • US Zip Code Formats NNNNN(-NNNN) - Can Both Be Used?
×
  • Existing user? Sign In
  • Sign Up
  • Browse

    • Back
    • Forums
    • Staff
    • Online Users
    • Leaderboard
    • Code of Conduct
  • Activity

    • Back
    • All Activity
    • Search
  • Go back to prestashop.com

    • Back
    • Go back to prestashop.com
    • Project on GitHub
    • Build blog
    • Dev Docs
    • User Docs
    • User Club
    • Addons Marketplace
×
  • Create New...

Tag » C-nnnn Postal Code