WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.

Donate with PayPal buttonSpenden mit dem PayPal-Button

  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Zip code / postal code
  • Print
Pages: [1]   Go Down

Author Topic: Zip code / postal code  (Read 4359 times)

Offline janarie

  • Posts: 3
Zip code / postal code
« on: September 16, 2010, 10:44:15 PM »
Hello,

Does anybody know how to remove the land-code in front of the zip code in all adresses (e.g. customers adress).
In the Netherlands it is not usual to show the Zip code as NL-5423 AA, but just as 5423 AA.
So I want to remove the NL- in front of the actual Zip code.

Can anybode help me?

Kind Regards,

Jan Arie
Logged

Offline svsanchez

  • Posts: 589
Re: Zip code / postal code
« Reply #1 on: November 22, 2013, 05:29:36 AM »
I am running into a similar problem. We don't use GT-Zip code in Guatemala either, but what is really causing me problems is that we use 1 and 2 digit zones in Guatemala, and Bakery will not allow people to put just "7" or "15" there. I guess the field is setup so that people are forced to write at least 4 digits. How can I tell Bakery to allow 1 or 2 digits for the zip code?
Logged

Offline svsanchez

  • Posts: 589
Re: Zip code / postal code
« Reply #2 on: November 22, 2013, 05:48:39 AM »
I think I found the solution for using less than 4 characters in the Zip code:

In /modules/bakery/view.php around line 523 you will see something like this:

if (strpos($field, 'zip') !== false) {
            if (!preg_match('#^[A-Za-z0-9 -]{4,10}$#', $value)) {
               $error_bg[] = $field;
               $errors[] = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_ZIP'];

What I did is change the number 4 in {4,10} to {1,10} and now I can use 1 or 2 digits in my Zip code. I hope this doesn't affect anything else :)
Logged

jacobi22

  • Guest
Re: Zip code / postal code
« Reply #3 on: November 22, 2013, 01:05:15 PM »
Quote
now I can use 1 or 2 digits in my Zip code. I hope this doesn't affect anything else

not for or in bakery, but maybe it makes sometimes more work for you, when your customer not send the correct postal code
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Zip code / postal code
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2