Copy link to clipboard
Copied
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>
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 b
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi Erick,
Thank you for your feedback.
The lookup is for mobile service availablility, therefore when someone is out on the road, they have a better chance of remembering which suburb they are in rather than the postcode.
I can see your point that it would be difficult to match all suburbs with their postcodes in the drop down, especially since Australia and New Zealand have a lot of them as well.
I will look into a suburb to postcode javascript generator, thank you for this idea.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Not to mention, that if they type the suburb in with wrong spelling...... then you will get no results.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
You had me at "over complicate" ..
Copy link to clipboard
Copied
What we have decided to do is have a web app, in a web app. We have a list of the suburbs and associated postcodes. We are going to have a search section for that (most possibly in an iframe) within the postcode proximity form, and then the customer can search for the suburb, and place the postcode the system spits out into the postcode field.
Simple
Copy link to clipboard
Copied
If you say so Luke I stopped reading at iFrame
Copy link to clipboard
Copied
We want to be able to search by city, state or country. I'm finding BC works fine out of box but need any customization and it's becomes complicated.
Not as exciting for development as I would have hoped. (:
Copy link to clipboard
Copied
That's why we use BC for old school style websites and use other platform for advanced ones