stefanoste Posted August 27, 2015 Share Posted August 27, 2015 (edited) Hi I'm from Japan and after I update from 1.6.0.14 to 1.6.1.1 the Zip code generate error (Attached ZipCode) The postal code in Japan is 000-0000 I Check the postal code in Menu Location - Country - Japan as default (attached Location) No matter what country or zip code I enter the result is always the same , after i insert the postal code the prestashop red warning Appear ... postal code is invalid Please advice how to fix it or how remove the red warning in the ZIP field? THX Edited August 27, 2015 by stefanoste (see edit history) Link to comment Share on other sites More sharing options...
stefanoste Posted August 27, 2015 Author Share Posted August 27, 2015 (edited) Anyone? Edited August 27, 2015 by stefanoste (see edit history) Link to comment Share on other sites More sharing options...
stefanoste Posted August 28, 2015 Author Share Posted August 28, 2015 Am I really the only one having this problem on Two different website???? cmon anyone can point me on the right direction PLEASE Link to comment Share on other sites More sharing options...
bellini13 Posted August 28, 2015 Share Posted August 28, 2015 I'm not sure why it is failing, but you can remove the zip code format from Japan by deleting NNN-NNNN. This way the zip code will be required, it just won't be validated against the NNN-NNNN pattern Link to comment Share on other sites More sharing options...
El Patron Posted August 28, 2015 Share Posted August 28, 2015 Please check that there is not an override (from some module) in: override/controllers/front/AddressController.php or AuthController.php because to me, because it works out of the box on native, that something has been changed to cause failure. Link to comment Share on other sites More sharing options...
Kron03 Posted September 3, 2015 Share Posted September 3, 2015 Hi Guys, i'm from Italy, i have the same problem with Zip code. In override/controllers/front/ i have only the index.php ..no other files. I have deleted also the NNNNN value but the result is always an error. PS. If you try to continue the subscription with the zip code error, you can successfull finished it .. the problem is only the "red color" of the input box...! it's a very singular error... Link to comment Share on other sites More sharing options...
ableier Posted September 3, 2015 Share Posted September 3, 2015 Bump... same issue here. United States. Deleted validation in BO, but zip shows a red error. It doesn't affect the actual registration, but is confusing to customers. DB show null for zip authentication as well. Any ideas?? Link to comment Share on other sites More sharing options...
Dochere195 Posted September 6, 2015 Share Posted September 6, 2015 Bump... same issue here. United States. Deleted validation in BO, but zip shows a red error. It doesn't affect the actual registration, but is confusing to customers. DB show null for zip authentication as well. Having the exact same issue. United States, with NNNNN in the zip code format field and with the field left empty... Any ideas? 1 Link to comment Share on other sites More sharing options...
Jiabin Posted September 7, 2015 Share Posted September 7, 2015 Ciao from Italy, same error here, nothing happens also disabling NNNN validations Admin -> countries panel... Link to comment Share on other sites More sharing options...
Kron03 Posted September 9, 2015 Share Posted September 9, 2015 Hi Guys, i have open a request to forge.prestashop.com about the bug. They have solved the problem. I have tryed and now all works fine. This is the solution: at this link you can find the solution to the bug: http://forge.prestashop.com/browse/PSCSX-4852 C ya guys and have a good day. 1 Link to comment Share on other sites More sharing options...
Dochere195 Posted September 9, 2015 Share Posted September 9, 2015 This worked perfectly, thanks Kron03 and all of those who helped. This is the solution: at this link you can find the solution to the bug: http://forge.prestashop.com/browse/PSCSX-4852 2 Link to comment Share on other sites More sharing options...
Logical IT Posted October 29, 2015 Share Posted October 29, 2015 Thanks Kron03 for posting solution. You have saved me hours of debugging! Link to comment Share on other sites More sharing options...
completepresta Posted November 8, 2015 Share Posted November 8, 2015 If still not working, i found out following:In address.tpl: countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code}; passed to validate.js: var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], countries[id_country]['iso_code']); countriesNeedZipCode returns a integer while the function expects an patern, socountriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code}; should be: countriesNeedZipCode[{$country.id_country|intval}] = {$country.zip_code_format}; then in validate.js:if (typeof(countriesNeedZipCode[id_country]) != 'undefined' && typeof(countries[id_country]) != 'undefined') {countries is always undefined: first thing is if you dont use states its never set:{if isset($country.states) && $country.contains_states} countries[{$country.id_country|intval}] = new Array(); {foreach from=$country.states item='state' name='states'} countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state}', 'name' : '{$state.name|escape:'htmlall':'UTF-8'}'{rdelim}); {/foreach} {/if} should move:countries[{$country.id_country|intval}] = new Array();to above the check for stateAnyway then countries still undefined in my validate.jsConclusion i fixed all changing: if (typeof(countriesNeedZipCode[id_country]) != 'undefined' && typeof(countries[id_country]) != 'undefined') { to: if (typeof(countriesNeedZipCode[id_country]) != 'undefined') { and var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], countries[id_country]['iso_code']); to var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], ''); and adress.tpl: changedcountriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code}; to: countriesNeedZipCode[{$country.id_country|intval}] = {$country.zip_code_format}; Hope this helps someone 1 Link to comment Share on other sites More sharing options...
ceegeeee Posted November 18, 2015 Share Posted November 18, 2015 Hello, Question on this: We run shops in the US, Canada and in several countries in Europe. We are having the same faulty validation issue for the US and Canada shops, but not the European ones. After applying the changes from http://forge.prestashop.com/browse/PSCSX-4852 the US and Canada shops are fixed, but now the European shops give the faulty validation error for any location that doesn't have a pattern defined in the BO in Localization > Countries. Any ideas on how to fix? Thanks in advance. Link to comment Share on other sites More sharing options...
ceegeeee Posted November 24, 2015 Share Posted November 24, 2015 Ok, found the issue. On line 125 of validate.js, the pattern assigned when no pattern is defined in the back office is: [a-z 0-9-]+ Because the Zip/Postal field gets forced to upper case, the RegExp test on line 139/140 kept failing...no upper cases in the pattern, so consistently found no match. Change it to [a-zA-Z 0-9-]+ so that lines 124 and 125 look like the following should fix the issue: if (typeof(pattern) == 'undefined' || pattern.length == 0) pattern = '[a-zA-Z 0-9-]+'; Posting in case others run into this issue. 2 Link to comment Share on other sites More sharing options...
tomekmo Posted April 13, 2016 Share Posted April 13, 2016 Hello, Question on this: We run shops in the US, Canada and in several countries in Europe. We are having the same faulty validation issue for the US and Canada shops, but not the European ones. After applying the changes from http://forge.prestashop.com/browse/PSCSX-4852 the US and Canada shops are fixed, but now the European shops give the faulty validation error for any location that doesn't have a pattern defined in the BO in Localization > Countries. Any ideas on how to fix? Thanks in advance. I did as above, but I have a problem with the theme, can anyone help me? Link to comment Share on other sites More sharing options...
Recommended Posts