Jump to content

Solved: Postal code isn't showed in any country


Recommended Posts

Hi

 

I have the following problem with prestashop:

 

As soon as somebody wants to buy something by going to the Cart, he will be asked to give an address; however, there is no field "Zip/Postal". See my attachment, so an error will popup and tell the buyer, that he needs to give one.

 

I don't really know how the field was gone, I have look at some of the countries and there I see that "Need zip code" is checked, so, it should appear. Where can I unhidde the field? I have look through the whole prestashop settings, but I haven't seen where to to it.

 

Best regards

Josef

post-437799-0-40491400-1363629155_thumb.jpg

Edited by jmeile (see edit history)
Link to comment
Share on other sites

Hi Pascal

 

I sent you the link in a private message. It isn't officially online, so, I don't want lots of dummy data on it. It is a prestashop 1.5.3.

 

If another person wants the link, please reply here.

 

Best regards

Josef

Link to comment
Share on other sites

Hi Benjamin

 

It is an upgraded website from version 1.5.2. Anyway, I thought that could be the issue, so, I reverted to the previous version, but the error was still there.

 

This is how I did the downgrade:

1) Before updating, I copied the whole prestashop folder

2) Then I did the automatic update

3) I saw that the postal code wasn´t showing, so, I deleted the updated installation and copied back the old version. And the problem was still there.

 

So, I guess there is somewhere a hidden configuration, which I don´t know. I suspect it is related to the localization -> Countries or the carriers, but I haven´t found anything I can set :-(

 

Anyway, since I don´t want the old version, I did the update again. What could be wrong?

 

Thanks for your reply

Josef

Edited by jmeile (see edit history)
Link to comment
Share on other sites

Hi Benjamin

 

This is actually happening when a customer visits the shop for the first time and wants to order something. He goes to the cart, then he creates a new account. Afterwards, he needs to write a shipping address, but since the "postal code" isn't displayed, he will become an error telling him that that field is required.

 

Currently I don't have any real customer. As I told before, the shop isn't officially online. I need to solve first this problem before making it official.

 

Best regards

Josef

Link to comment
Share on other sites

Hi Josef,

Can you check something for me? Check in /classes/address.php if there is a 'postcode' field in the

 

fields array of:

 

 

public static $definition = array(

'table' => 'address',

'primary' => 'id_address',

'fields' => array(

...

 

'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12),

...

}

 

Should be just under field 'address2', around line 125 in1.5.3.1

 

Just a try...

It looks like the 'postcode' field is just not in the array that creates the address input screen (if it's not in the array, it skips this input field)

Link to comment
Share on other sites

Hi Pascal

 

Yes, the postcode is on line 124.

 

Anyway, just for the records:

The last upgrade I did was like this:

1) Backed up the current prestashop files + Database and moved them to another location

2) Drop all tables from database

3) Installed prestashop 1.5.3 from scratch in the same location where the old store where and using the same database name.

4) Tested to see if the error happened with that clean install -> It didn't occured

5) Import the backup of the database

6) Copied the images and a personalized theme from my old files.

7) Tested with the installation -> The error still happened

8) Changed my own theme to the default theme -> The error still happened

 

So I think this is some setting stored in the database.

 

 

Thanks for your reply

Edited by jmeile (see edit history)
Link to comment
Share on other sites

Hi

 

I just found the error and I think it is a bug, so, I will submit it.

 

Here it goes:

 

The main country of the store is Colombia. There you don't use postal codes, so, I set the "Need zip code" field of that country to "No". Then I dropped it from the address format and leave it like:

 

firstname lastname

company

address1

address2

city State:name

Country:name

Customer:email

phone

Address:phone_mobile

 

The problem was that each time a new address is created, by default, the first selected country would be "Colombia", so, the defined address format for that country is shown. If a change the country, the address format for Colombia remains, so, the "postal code" field will be hidden.

 

I fixed it adding the "postal code" field for Colombia and setting the "Need zip code" to "No". I can leave with that, but I guess that's a bug. The expected behaviour would be that each time you change the country, its address format must be used and not the one defined by your standard country.

 

Best regards

Josef

Link to comment
Share on other sites

Hi Josef,

Sounds very plausible as the reason why things go wrong. Nice research!

A day or ten ago, we encountered a similar problem in the forum, with someone having problems with states. I'll check if this is similar to this problem.

Thanks for sharing, and yes sounds like a bug, or at least a "non desirable feature" :-)

 

Pascal

Link to comment
Share on other sites

  • 3 years later...

Hi Pascal

 

Yes, the postcode is on line 124.

 

Anyway, just for the records:

The last upgrade I did was like this:

1) Backed up the current prestashop files + Database and moved them to another location

2) Drop all tables from database

3) Installed prestashop 1.5.3 from scratch in the same location where the old store where and using the same database name.

4) Tested to see if the error happened with that clean install -> It didn't occured

5) Import the backup of the database

6) Copied the images and a personalized theme from my old files.

7) Tested with the installation -> The error still happened

8) Changed my own theme to the default theme -> The error still happened

 

So I think this is some setting stored in the database.

 

 

Thanks for your reply

 

Up to this date, it is still a problem and thanks for the soloution!

Link to comment
Share on other sites

×
×
  • Create New...