Jump to content
artofadornment

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Of course, improve some validation methods.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Bumping this topic.

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More