Forums / All Other Contributions/Addons / Postcode Auto Fill support thread

Postcode Auto Fill support thread

Views: 4,384

Results 1 to 18 of 18
1 May 2023, 10:38 AM
#1
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Postcode Auto Fill support thread

This thread is their to support plugin 'Postcode Auto Fill':
https://www.zen-cart.com/downloads.php?do=file&id=2370
When you enter postal or zip code in a form, this plugin auto-fill state, city and, if data available, street address fields in 'create account' page, 'address book' edit and 'new address checkout' pages.
If multiple choices are available a nice Jquery/Javascript popup tool will appear on the right when hovering the field.
Thanks to an AJAX query, all this is done on the fly without need to reload the form.
Postal/zip code data are stored in database in new tables (One for each country). Three countries data are provided, US, France and Japan. Of no need to install all of them, you need the ones where most of your customers are at minimum.
This plugin is nearly drop in type and should be easy to install. Hard part might be to build your own data for your country if not available yet. Basic instructions to do so are on the read me file and if it is not enough you have this thread.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

25 May 2023, 1:14 PM
#2
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Version 1.2 is now available in plugin section:
Postcode auto fill Part 1
New countries data have been added and now all countries that had zone defined in default Zen Cart except Canada are included.
This countries are United States, Spain, Germany, Italy, Swiss, Liechtenstein (included with Swiss), Austria, Australia, France and its territories and Japan.
Unfortunately plugin upload size is limited and I had to split the zip in two...
Second part contains postal codes data for US, Austria and Japan (if you have installed Japanese zones from Japanese Language Pack ZC v158).
Postcode auto fill Part 2
You need to install part one to use these data.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

2 Mar 2024, 8:27 AM
#3
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Just submitted v1.3.1 for part 1, which is an update of SQL file for Japanese postal codes when no zone is defined for Japan.
Postcode auto fill Part 1
Part 2 does not need to be updated, please use v1.3.
Postcode auto fill Part 2

This release is probably the last one for Zen Cart 1.5.8a. A new version for ZC V2.0.0 will be there soon.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

25 Nov 2024, 2:35 PM
#4
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

New encapsulated v2.0.0 of this plugin for Zen Cart v2.1.0 has just been submitted to plugin section. Also availabkle on GitHub here.
Now renamed "Postal Code Automatic".
From now on, it should be easier than ever to install, update or uninstall.
If you have an older version, please uninstall it (you can let database tables as is). See documentation in index.html file for details.

Content of the plugin does not change. It includes postal codes data for following countries:
Australia
Austria
France
Germany
Italy
Japan
Spain
Suiss (including Liechstenstein)
United States of America

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

2 Apr 2025, 1:24 PM
#5
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Postcode Auto Fill support thread

Has anyone used this for Canada?

4 Aug 2025, 3:24 PM
#6
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

V2.0.2 of this encapsulated plugin has been submitted in plugin section and should be available soon.
It is available on Github here.

It corrects a bug in SQL queries where missing country zones will stop installation.
Some code cleaning was done too.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

16 Dec 2025, 9:05 PM
#7
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Postcode Auto Fill support thread

I had v2.0.1 installed, uploaded v2.0.2 to zc_plugins, uninstalled V2.0.1, installed v2.0.2 and received warning on Plugin Manager screen only (no log files)

Unknown collation: 'utf8mb4_ja_0900_as_cs_ks'
Table 'zc220_exp.zones_to_post_code_jp' doesn't exist and module is not installed.

ZC 2.2; PHP8.4, MariaDB

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

17 Dec 2025, 5:48 AM
#8
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

I see you are using MariaDB. It does not seem to support the collation 'utf8mb4_ja_0900_as_cs_ks'.
It should be working by replpacing the collation utf8mb4_ja_0900_as_cs_ks by some MariaDB equivalent at the begining of the Japanese postal cade SQL file (lines 9 & 10).
Un fortunately I am not sure MariaDB as an equivalent, I don't have any MariaDB server at hand to test that.
If you do not need Japanese postal codes, you can although modify line 6 of ScriptedInstaller.php, removing 'jp' from the list.

But if version 2.0.1 was working fine there was probably a collation that can be used.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

17 Dec 2025, 6:35 AM
#9
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Postcode Auto Fill support thread

Thanks. The collation for MariaDB is "uca1400_ai_ci" (based on Unicode 14.0) for versions 10.11+

When the postcode (zip code) is entered and the city list is returned in the pop-up window, are the city /towns names supposedto be selectable?

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

17 Dec 2025, 8:30 AM
#10
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Yes, for Japan, city and suburb are supposed to be selectable (if there are multipe choices).

The table itself uses general collation but two fields need a 'kana sensitive' collation.

Try replacing 'utf8mb4_ja_0900_as_cs_ks' in file 'zc_plugins\PostAuto\v2.0.2\installer\sql\install\zones_to_post_code_jp.php' by 'uca1400_as_cs' on lines 9 and 10.
If the database can't make the difference between katakana and hiragana, for exemple ア and あ which read the same, then there will be a duplicate index error when installing and everything after this error won't be installed.
If it can make the difference then everything should be installed properly.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

17 Dec 2025, 8:23 PM
#11
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Postcode Auto Fill support thread

Are non-japanese locations supposed to be selectable?
Select country = Australia, entering postcode 4121 returns the surburb Holland Park.
If I click on the suburb field the alternate suburbs (Holland Park, Holland Park East, Holland Park West, Tarragindi, Wellers Hill) are listed in a pop-up box.

They are not selectable from the list. Should they be?

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

18 Dec 2025, 2:20 AM
#12
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

OldNGrey:

Are non-japanese locations supposed to be selectable?
Select country = Australia, entering postcode 4121 returns the surburb Holland Park.
If I click on the suburb field the alternate suburbs (Holland Park, Holland Park East, Holland Park West, Tarragindi, Wellers Hill) are listed in a pop-up box.

They are not selectable from the list. Should they be?

When you click on one of them, in the popup, the field choose change according to your choice.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

18 Dec 2025, 3:01 AM
#13
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

pilou2:

When you click on one of them, in the popup, the field choose change according to your choice.

Typo; ... the field should change according to your choice.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

10 Feb 2026, 9:02 AM
#14
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Version 2.0.3 has just been submitted to plugin section here.

Minor update to correct some bug with databases using prefix.
Possible bug correction when multiple results are available.
Extra languages files included by default.

If you can't wait, it is on GitHub here.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

7 Aug 2026, 2:13 PM
#15
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Version 2.0.7 has been released.
It brings few code changes, mainly for improve stability and wider compatibility:

  • Improved JavaScript to display options for street address that are relevant to the chosen city.
  • Chapter on usage added in documentation.
  • Improved JavaScript file loading to make it compatible with ZC v3.0.0.
  • Should now work from ZC v2.1.0 to v3.0.0 and newer.
  • Added an observer to prevent redirects of the AJAX request. This improves compatibility with other plugins like "Admin Add Customer".

There are still some small intermittent glitches with JavaScript in tooltip where the popup is not always responsive to clicks. Moving the mouse away and back in the field generally fixe it. Unfortunately, those come from some code I did not write in the Tooltip used by this plugin.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

27 Sep 2026, 7:37 AM
#16
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

Well, I found a problem with version 2.0.7 release. The code added for compatibility with Admin Add Customer plugin actually introduces some bugs by blocking some redirects here and there.

Please downgrade to v2.0.6 until v2.0.8 is released.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

27 Sep 2026, 8:54 AM
#17
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
407
Plugin Contributions:
6

Re: Postcode Auto Fill support thread

V2.0.8 has been submitted to plugin section.

Added buttons/links to doc, GitHub and support forum in plugin description.
Important bug fix: Added a condition to limit the redirect block to AJAX call.
Documentation improvement.

Please upgrade as soon as possible to correct v2.0.7 bug.

Although on GitHub here.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

16 Oct 2026, 6:33 PM
#18
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
375
Plugin Contributions:
0

Re: Postcode Auto Fill support thread

zc 2.1.0. php 8.2. opc 2.7.0

Hi. I just installed the Postcode 2.0.8 but I cannot make it work. Per your instruction, during the OPC checkout page, I first filled the zipcode, but the city & state didn't pop up/fill automatically. I verified the zipcode in the datafile (zones_to_post_code_us.php).

One strange thing I need to mention is, I thought the installation process should take a while after I hit the button under the plug-in manager, since a batch of database files need to be loaded. But it is not. It is very fast like any other plug-ins. But I can still get the installation success note on the top.