Skip navigation
Luke Johns
Currently Being Moderated

Web App - Search by Suburb instead of Postcode (With Distance)

Jul 16, 2012 5:52 PM

Tags: #web_app_search_results #search_by_suburb

Hi,

 

I hope someone can help me with this.

 

We have setup a web app to list the location of all their New Zealand stores.

 

The client would like the ability for customers to search by suburb rather than postcode within a 100km radius. Their reasoning behind this is because customers will remember a suburb rather than a postcode.

 

I have used the BC module tags, layouts and search forms and it is working perfectly for postcode. I just want to add another input box so that the customer can search by suburbs in their radius (maximum of 100km).

 

How would I go about doing this?

 

I thought it would be a simple case of copying the 'Postcode' input and updating in to 'City' or 'Suburb' as in example below, but I was mistaken:

 

<div class="item">

     Search by Suburb:<br />

     <input type="text" name="City_16000" id="City_16000" class="cat_textbox" maxlength="255" style="width: 180px;" />

</div>

<div class="item">

     Search by Postcode:<br />

     <input type="text" maxlength="255" name="Postcode_16000" id="Postcode_16000" class="cat_textbox" style="width: 150px;" />

     <input type="hidden" id="Country_16000" name="Country_16000" value="NZ"/>

</div>

 
Replies
  • Currently Being Moderated
    Jul 18, 2012 9:23 AM   in reply to Luke Johns

    The use case for the proxmity search feature is that the customer enters their own postcode, and nearby results are returned.  I don't see why a customer would have trouble remembering their own post code.

     

    However I can see the case where a customer wants to search for a store in a particular area, but not necessarily their own area, and may not know the postcode for that.

     

    You can search by exact city/suburb match by simply creating fields to hold this information for each item.  Or just use the builtin address fields.  However this will not enable proximity searching, just an exact match.

     

    To do any kind of proximity matching, you will have to submit the postcode value, that's the only way BC has to do this.  You could craft the UI to abstract this though.  It would involve using some technique to map names to postcodes.

     

    A simple implementation could be done with a drop down such as

     

    <select name="Postcode_1600">

    <option value="90210">Suburb 1</option>

    <option value="90215">Suburb 2</option>

    <option value="90218">Suburb 3</option>

    </select>

     

    In that example the user would see the name of the suburb, but the value submitted to the form would be the postal code.  There are obvious drawbacks to that approach.

     

    A more complicated, but possibly more useful way to do it would be to setup or subscribe to some sort of service that can translate city or suburb names to postal codes, and query that for the post code, and then submit the returned value.  This would involve significant JavaScript though, and a service specially designed for this.   Or you could create your own and host it yourself external to BC. I would not consider this a trivial endeavor, but certainly possible.

     
    |
    Mark as:
  • Liam Dilley
    6,689 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 18, 2012 5:45 PM   in reply to Luke Johns

    Really do not see the need in all of that.

    http://www.orijen.co.nz/new-zealand-stockists
    You see the link about find out your postcode. I am sure Postal services in OZ has these as well and just hook into those.

    Just more simple, Postcode find works so well in BC and can make for simple clean layouts, just this bit helps people find their postcode if for someo reason they do not know it.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 18, 2012 6:40 PM   in reply to Liam Dilley

    Not to mention, that if they type the suburb in with wrong spelling...... then you will get no results.

     
    |
    Mark as:
  • Liam Dilley
    6,689 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 18, 2012 6:55 PM   in reply to Fubals

    True,
    It often easy to over complicate things, Software developers often prone to this, lol. Always good to break down the problem and always look for the most simplicest sollution. That normally is always the best

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 18, 2012 7:02 PM   in reply to Liam Dilley

    You had me at "over complicate" ..

     

     
    |
    Mark as:
  • Liam Dilley
    6,689 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 18, 2012 7:34 PM   in reply to Luke Johns

    If you say so Luke I stopped reading at iFrame

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points