PostCode Lookup - Displaying all results
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
PostCode Lookup - Displaying all results
Hello CMSMSers,
I have built a website with the dealer locator page using Company Directory and Postcode Lookup. Randomly on accident I just ran into an issue (call it a glitch, bug, whatever you think it is). If you don't input a zipcode into the Zipcode area and hit submit (no matter what search radius) it ends up showing nearly all the companies in the Company Directory and showing all their points on the map. Is there a way to tell it to not search with an empty zip code field?
Thanks in advance!
I have built a website with the dealer locator page using Company Directory and Postcode Lookup. Randomly on accident I just ran into an issue (call it a glitch, bug, whatever you think it is). If you don't input a zipcode into the Zipcode area and hit submit (no matter what search radius) it ends up showing nearly all the companies in the Company Directory and showing all their points on the map. Is there a way to tell it to not search with an empty zip code field?
Thanks in advance!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
still can't find where to fix this ... any ideas??
Re: PostCode Lookup - Displaying all results
sounds like it should require only a simple source hack, making the search conditional on IF the postcode box is not null/empty. You just need to find the code that manages the search. I'll look tonight if I remember.
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
SEEMS like a simple hack! hahah.
. I am far from a "hacker" and my coding skills are limited. Would love to know how to fix this easily! Look forward to seeing if you find anything!

Re: PostCode Lookup - Displaying all results
sorry - forgot about this. I'll try (again) to remember...
Re: PostCode Lookup - Displaying all results
what lookup method are you using (database, online-only, etc.)?
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
I'm using online lookups only. It has worked in the past, but for some reason it isn't working now... so confusing!
Re: PostCode Lookup - Displaying all results
you say it has worked in the past - if it worked in the past, there's no reason for the behavior to change unless something else changed. Did you upgrade? Edit templates? Edit source?? Edit/change/modify/upgrade anything?? At all? Throughout the site, even?
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
All I've done is change the background for the containing the block and I updated Company Directory using the Module Manager.
Was the latest update of Company Directory different to where it could've messed up my link with Postcode?
Was the latest update of Company Directory different to where it could've messed up my link with Postcode?
Re: PostCode Lookup - Displaying all results
I don't know for sure, but it's certainly a possibility. Do you have a staging/development site where you could revert to an older version of CD to see if the older version works?
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
Ok. So, I went back and installed Company Directory 1.5.3 (cause of my PHP settings, the highest CD module I could install was 1.5.4). The CD is still having the issue of pulling up every single result when searched!
Does anyone else have any suggestions?? I can't seem to find a fix!
Does anyone else have any suggestions?? I can't seem to find a fix!
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
Yea.. I've been having this issue for almost a month now... I think i'm driving myself crazy! I can't seem to fix it!!
Re: PostCode Lookup - Displaying all results
I wish my postcode lookup actually posted results. I'll look in to your issue as I want to be doing the same way and maybe you can offer some feedback on getting the postcode search to actually find results?
Re: PostCode Lookup - Displaying all results
I have the same problem when I use the code line:
$postcode = cge_utils::get_module('PostCode');
instead of $postcode = cge_utils::get_module('Postcode');
Not pro at this stuff but i have been running lots of trials to get it to work.
I have noticed that you should use "$postcode = cge_utils::get_module('Postcode');" which should give the error "Could not find any information for postal/zip code xxxx". If you havent imported the Postcode list with geodetails then you need to make sure operation mode is set to Online Lookups only. PHP function CURL_INIT must be set. Otherwise you get the following error
"Fatal error: Call to undefined function curl_init() in /home/maria/public_html/modules/Postcode/Postcode.module.php on line 238"
$postcode = cge_utils::get_module('PostCode');
instead of $postcode = cge_utils::get_module('Postcode');
Not pro at this stuff but i have been running lots of trials to get it to work.
I have noticed that you should use "$postcode = cge_utils::get_module('Postcode');" which should give the error "Could not find any information for postal/zip code xxxx". If you havent imported the Postcode list with geodetails then you need to make sure operation mode is set to Online Lookups only. PHP function CURL_INIT must be set. Otherwise you get the following error
"Fatal error: Call to undefined function curl_init() in /home/maria/public_html/modules/Postcode/Postcode.module.php on line 238"
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
I was building a new website yesterday and went to install CD 1.5.4 (since i'm running CMSMS 1.6.
and after installing, i couldn't input companies cause it said the tables didn't exist. So it seemed like something in 1.5.4 was messing up where it wouldn't create any tables in my database (Couldn't even add field definitions or categories).
I then went to 1.5.3 and it installed perfectly and could add info. So maybe there is some small little hitch in the newer versions that is hindering us?
I can test the postcode module and it finds the postcode location just fine. So it's somewhere in the communication from postcode to CD to CGGM that things are a little funky.

I then went to 1.5.3 and it installed perfectly and could add info. So maybe there is some small little hitch in the newer versions that is hindering us?
I can test the postcode module and it finds the postcode location just fine. So it's somewhere in the communication from postcode to CD to CGGM that things are a little funky.