That's the stuff, thanks DrByte
I'll detail what I've done now so that others looking for the same thing can find it here.
To disable Post Code validation in cases where this field is not essential or required, one normally sets Admin, Configuration, Minimum Values, Post Code = 0.
This is a common requirement in New Zealand where people usually have no idea what their post code is and to top it off the postal service recently changed them all around in order to improve their own internal processes at the cost of everyone else'.
Because this doesn't work properly in 1.302 and presumably also in 1.35 and 1.36, apply the fix DrByte has given. There may be other files that need this, but I've so far only found these ones:
In these files
- includes/modules/pages/account_edit/jscript_form_check.php (line 31)
- includes/modules/pages/create_account/jscript_form_check.php (line 31)
- includes/modules/pages/login/jscript_form_check.php (line 31)
- includes/modules/pages/address_book_process/jscript_main.php (line 31)
- includes/modules/pages/checkout_shipping_address/jscript_main.php (line 38)
- includes/modules/pages/checkout_payment_address/jscript_main.php (line 38)
Add the red bit below to the check_input function at the line indicated:
function check_input(field_name, field_size, message) {
if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
if (field_size == 0) return;
var field_value = form.elements[field_name].value;
Now if the Minimum value is set to zero, the form will validate correctly for the pages listed.
An additional interface fix is to remove the red asterisk next to the field so that the customer knows it is not required.
In file includes/languages/english.php
Remove the asterisk in line 219:
Remove asterisk from: define('ENTRY_POST_CODE_TEXT', '*');
These changes are not safe from a cart upgrade, but if you check after upgrading, they may no longer even be needed.
Regards,
Rob