Page 1 of 2
PostCode Lookup - Displaying all results
Posted: Thu Jun 24, 2010 4:54 pm
by michaywood
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!
Re: PostCode Lookup - Displaying all results
Posted: Fri Jun 25, 2010 1:44 pm
by michaywood
still can't find where to fix this ... any ideas??
Re: PostCode Lookup - Displaying all results
Posted: Fri Jun 25, 2010 3:48 pm
by jmcgin51
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.
Re: PostCode Lookup - Displaying all results
Posted: Mon Jun 28, 2010 4:02 pm
by michaywood
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
Posted: Fri Jul 02, 2010 2:30 pm
by jmcgin51
sorry - forgot about this. I'll try (again) to remember...
Re: PostCode Lookup - Displaying all results
Posted: Sat Jul 03, 2010 2:12 am
by jmcgin51
what lookup method are you using (database, online-only, etc.)?
Re: PostCode Lookup - Displaying all results
Posted: Tue Jul 06, 2010 1:33 pm
by michaywood
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
Posted: Thu Jul 08, 2010 2:29 am
by jmcgin51
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?
Re: PostCode Lookup - Displaying all results
Posted: Tue Jul 13, 2010 5:58 pm
by michaywood
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?
Re: PostCode Lookup - Displaying all results
Posted: Tue Jul 13, 2010 6:04 pm
by jmcgin51
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?
Re: PostCode Lookup - Displaying all results
Posted: Fri Jul 23, 2010 9:24 pm
by michaywood
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!
Re: PostCode Lookup - Displaying all results
Posted: Mon Aug 02, 2010 4:17 pm
by michaywood
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
Posted: Mon Aug 02, 2010 7:06 pm
by inyerface
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
Posted: Tue Aug 03, 2010 8:28 am
by james123
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"
Re: PostCode Lookup - Displaying all results
Posted: Tue Aug 03, 2010 1:15 pm
by michaywood
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.