Hello,
Many of users has complained the script only takes British ZIP codes. While we are preparing new update with this feature corrected, here's a brief guide to D.I.Y instantly :armada6:
Basically we need to edit javascript validating the ZIP code, this will include changing the same thing in 4 template files:
HTML Code:
/YOUR_TEMPLATE_MAIN_DIR/templates/module.register_step2.tpl
/YOUR_TEMPLATE_MAIN_DIR/templates/module.register_step3.tpl
/YOUR_TEMPLATE_MAIN_DIR/templates/module.userdata_update_step2.tpl
/YOUR_TEMPLATE_MAIN_DIR/templates/module.userdata_update_step3.tpl
In each of the above files find this piece of code:
HTML Code:
if(frm.SHIPPINGPOSTCODE1.value.search(/\S/)==-1){
frm.SHIPPINGPOSTCODE1.value='';
alert('Please enter first part of shipping postcode !!');
frm.SHIPPINGPOSTCODE1.focus();
return false;
}
if(frm.SHIPPINGPOSTCODE1.value.length != 3 ){
alert('Please enter 3 characters in first part of shipping postcode !!');
frm.SHIPPINGPOSTCODE1.focus();
return false;
}
if(frm.SHIPPINGPOSTCODE2.value.search(/\S/)==-1){
frm.SHIPPINGPOSTCODE2.value='';
alert('Please enter second part of shipping postcode !!');
frm.SHIPPINGPOSTCODE2.focus();
return false;
}
if(frm.SHIPPINGPOSTCODE2.value.length != 3 ){
alert('Please enter 3 characters in second part of shipping postcode !!');
frm.SHIPPINGPOSTCODE2.focus();
return false;
}
Now, there's many ways you might edit it, from allowing users to enter anything in the ZIP code, to specifying number of letters/numbers.
Example 1. Allow all:
Remove this part of code form the script.
Example 2. Allow all:
Change each
to
.
Example 3. ZIP with 4 letters/numbers in front and 2 in second part (e.g. 22AW A7)
Change this:
HTML Code:
if(frm.SHIPPINGPOSTCODE1.value.length != 3 ){
alert('Please enter 3 characters in first part of shipping postcode !!');
into:
HTML Code:
if(frm.SHIPPINGPOSTCODE1.value.length != 4 ){
alert('Please enter 4 characters in first part of shipping postcode !!');
(first part of the ZIP must now be 4 characters)
and change this:
HTML Code:
if(frm.SHIPPINGPOSTCODE2.value.length != 3 ){
alert('Please enter 3 characters in second part of shipping postcode !!');
to this:
HTML Code:
if(frm.SHIPPINGPOSTCODE2.value.length != 2 ){
alert('Please enter 2 characters in second part of shipping postcode !!');
(second part of the ZIP must now be 2 characters long)
PLEASE NOTE: modifying these 4 files will only for your current template will only take effect in this template, to have it applied to other templates you need to update the adequate files in them too.
The script error messages in each part of the code are pretty much descriptive so I guess you shouldn't have any problem with applying the proper settings for your site. However should you meet any problems please let me know.
Best Regards,
Piotrek