PostCode Lookup - Displaying all results

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

PostCode Lookup - Displaying all results

Post 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!
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post by michaywood »

still can't find where to fix this ... any ideas??
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: PostCode Lookup - Displaying all results

Post 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.
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post 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!
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: PostCode Lookup - Displaying all results

Post by jmcgin51 »

sorry - forgot about this.  I'll try (again) to remember...
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: PostCode Lookup - Displaying all results

Post by jmcgin51 »

what lookup method are you using (database, online-only, etc.)?
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post 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!
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: PostCode Lookup - Displaying all results

Post 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?
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post 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?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: PostCode Lookup - Displaying all results

Post 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?
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post 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!
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post 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!!
inyerface
Forum Members
Forum Members
Posts: 191
Joined: Mon Nov 26, 2007 4:46 pm

Re: PostCode Lookup - Displaying all results

Post 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?
james123
Forum Members
Forum Members
Posts: 12
Joined: Thu Nov 12, 2009 12:05 pm

Re: PostCode Lookup - Displaying all results

Post 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"
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: PostCode Lookup - Displaying all results

Post by michaywood »

I was building a new website yesterday and went to install CD 1.5.4 (since i'm running CMSMS 1.6.8) 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.
Locked

Return to “Modules/Add-Ons”