Is there a way to search by storename?

Is there a way to search by storename? I have a lot of different stores and would like to search by storename if possible. Thank you in advance!

You can do a search by

You can do a search by storename using a non-radius type of search but it would require some modifications to the app that you probably wouldnt be capable of doing on your own. There would be no reference for the 'you are here' coordinate and would essentially be nothing more than just a regular ol mysql search result with no 'you are here' reference which currently the inradius() function needs in order to operate. It would need to be modified to allow for no center coordinate. If you want to use the existing inradius function with just a couple very easy mods that I could show here then on the search page you would need to ask them for a storename AND where they are located (a zipcode would be enough). If you do it that way, then it would be easy to add to the inradius() function. Otherwise you'd have to build your own mysql query which would probably require more knowledge of php than you have. There is another trick that you could use that I've seen done before as well. If you know any javascript then you could code up a JS to change the person's zipcode to a static value based on what they selected from a dropdown menu of storenames. But thats also pretty involved since it requires JS.

Now thinking about

Now thinking about it..you're right. Store name and zip code would be great. Can you point me in the right direction to mod the inradius function?

Here you go. Try this,

Here you go. Try this, add a html new field to the search form called 'storename'. Then in the phpGoogleStoreLocator-functions.php file do this:

(This is for version 2.x.x but you can do the exact same thing in 3.x as well, the inradius function in 3.x is in phpGoogleStoreLocator-class.php instead)

Change:

<?php
$query
="SELECT *,(((acos(sin(($lat*$pi/180)) * sin((lat*$pi/180)) + cos(($lat*$pi/180)) *  cos((lat*$pi/180)) * cos((($lon - lon)*$pi/180))))*180/$pi)*60*1.423) as distance FROM locations HAVING distance <= $radius AND $category_search AND (expiration_date >= NOW() || expiration_date = '0000-00-00 00:00:00') ORDER BY distance ASC $results_limit";
?>

To:

<?php
$query
="SELECT *,(((acos(sin(($lat*$pi/180)) * sin((lat*$pi/180)) + cos(($lat*$pi/180)) *  cos((lat*$pi/180)) * cos((($lon - lon)*$pi/180))))*180/$pi)*60*1.423) as distance FROM locations HAVING distance <= $radius AND $category_search AND (expiration_date >= NOW() || expiration_date = '0000-00-00 00:00:00') AND storename LIKE '{$complete_address[storename]}'  ORDER BY distance ASC $results_limit";
?>

This should return any stores that have a storename that matches what was typed in the form either from a drop down list that you make or maybe from a text field that they typed in.

This works! Thank you!

This works! Thank you!