Single Site $9.99

1 site, unlimited servers No source distribution Commercial use allowed Can modify source 1 year support Read full license

Multi-Site $19.99

Unlimited applications Binary restricted distribution Commercial use allowed Can modify source 1 year support Read full license

Developer License $39.99

Unlimited projects Source and binary distribution Commercial use allowed Distribute modifications 6 months support Read full license

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Starting from $ 9.99

View Pricing 14 days money-back guarantee
(8 ratings)

PHP & AJAX Store Locator

An easy-to-configure PHP, AJAX & MySQL store locator script using Google Maps.

Description

This is a fully featured store locator that you can use to provide easy store locator functionality to your (or your client's) website in under 5 minutes.

Features

  • Easy to configure and set up. (minimal coding skills required)
  • Uses Google Maps API v3 - No API key required!
  • Highly commented, with extra documentation included. (with package)
  • Admin Panel for listing, editing and removing stores.
  • Front-End for adding stores.
  • Easily integrated into existing website - minimal styling, login systems, etc.
  • Uses jQuery library for effects and AJAX.

Does this script use any JavaScript libraries?

Yes, it uses the latest jQuery library (1.6.2 at time of publishing).

What is "geocoder"/"geocoding"?

Geocoding is the process of converting a string into a latitude/longitude pair. A geocoder is a script/tool that geocodes addresses.

What is "region biasing"?

Region biasing, put simply is biasing results/favoring results from one region over another. For example, let's say a user typed in San Francisco as a location. If the region was set to the US, the geocoder pick San Francisco, CA over other results from other regions, such as San Francisco, Spain. Vice-versa, if the region was set to ES, it would pick San Francisco in Spain. That's why it's very important to set the region.

Back to top

Installation

The configuration of this script is quick and easy, and should not take more than 3 minutes. This requires no skill other than copying/pasting text and editing a basic file.

Almost all of the configuration is done in the settings.php file, which is in the /bin directory. Out of the box, it should look something like this:

<?php
//Database Connection information.
$host="hostname"; //usually localhost
$username="username";
$password="secret";
$db_name="dbname";

//The unit of distance. If you want to use KM instead, put 'kilometers'
$unit = "miles";
$hav_int = 3959;    
//convert the unit string to a number.
if ($unit=="kilometers") {  
    $hav_int = 6371;
}
?>

Quick Setup (3 Steps)

  1. Unzip the directory into your location of choice (probably /public_html)
  2. Change your database connection information at the top ( the top 4 variables)
  3. Import the 'import.sql' file in the /bin folder which will create a folder called "stores" in your database of choice. Make sure that you are in the database of choice

Once you have done that, you are ready to roll out the script. However, you might want to make some localizations to your script (especially if you're deploying outside of the US).

Localizations

  1. In order to change default location of the map (from San Francisco, CA), you need to know the latitude and longitude of your new location, (if you don't know you can use a free geocoder like Tiny Geocoder). Then, go to add.js and locator.js (in the "js" folder), and in each file there is a line : var def_coords = {'lat' : 37.775196, 'lng': -122.419204};. replace 37.775196 with your latitude, and replace -122.419204 with your longitude.
  2. Change the $unit variable in settings.php to "kilometers" if you want kilometers, or keep it as miles depending on what is used in your country.
  3. Go to add.js, edit.js, and locator.js (in the "js" directory) and in each file at the top, there is a line: var region = 'us'; if you would like to change the region, you have to change it to ccTLD abbreviation for your country. (the top-level domain name). For example, you could set it to ca, or uk.
Read all 24 comments »

Questions & Comments

  • Simon Choy License holder said:

    2 months ago
    Hi, very happy with the script so far. On the add.php page I wanted to include more fields so I can store other criteria in the database beyond the defaults (for example, also input an email address). I tried fiddling with it myself and structured the database appropriately but couldn't get add.php to successfully insert the new fields into the database. How would I go about doing this?
    • Souleiman Benhida Author said:

      2 months ago
      Hi, it's a little bit more complicated than add.php to add new criteria. First, you have to add it into the MySQL DB, then add as a form in add.php, then add as a form in bin/backend.php, then go into js/locator.js and add it as a field there, as well as add as a field in genxml.php. All in all it looks complicated on paper but isn't really that hard at all. I plan to release a huge update (IA) on Saturday or Sunday so, if you can wait until then that would be great. I will try to add an (optional) email address field.

      What are the fields you would like?
      Thanks.
    • Souleiman Benhida Author said:

      2 months ago
      Hey, Did you figure out how to add a new one?
    • Simon Choy License holder said:

      2 months ago
      Yes, thanks! After you pointed me where to go it was simple to emulate the existing code to add an additional variable.
    • Souleiman Benhida Author said:

      2 months ago
      Great! You saved me some work :), you're a smart programmer and I guess my code isn't as bad as I thought. I'll try to add that info to the manual.

      Cheers!
  • stereotypical said:

    2 months ago
    is it possible to add the get directions functions on this store locator?
    • Souleiman Benhida Author said:

      2 months ago
      Hi,

      Thanks for the idea, I think it's a good idea. This is how I think I can implement it:

      In the locator results i can add a link saying "Get Directions", which opens in a new tab page google maps with the store address pre-loaded.

      I'll try to get to this feature soon,

      thanks!
  • Cori License holder said:

    4 months ago
    I have a client who wants to try this....can you edit the style or something to help make it match her site? Other Than just "whiteish" Thanks!
    • Souleiman Benhida Author said:

      4 months ago
      Hi,
      I can help do some basic customization.. I am a programmer, not a designer ;).

      I made the CSS files sort-of easy to change but if you want me just to change the colour scheme I can do it for you, that only takes a few minutes.

      Cheers!
    • Souleiman Benhida Author said:

      4 months ago
      Hi,

      I just wanted to follow up and see if you figured out how to customize the locator to your liking without my help?

      Thanks!

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
You must be logged-in to vote. Log-in to your account or register now.
View all 7 reviews »

User Reviews

    I had this fully up and running in about 10 minutes. Other than knowledge on how to set-up a database, it's all self-explanatory from there and the developer made it nice and easy. Saved me days of coding!
    - Stephen O'Neal, 2 months ago
    Flag review
    Was this helpful? Yes No
    Excellent component; very well commented, adaptable to other purposes and fantastic value.
    - Khalid Boutin, 3 months ago
    Flag review
    Was this helpful? Yes No
    Way to go, Souleiman. This is an elegant AJAX store locator that uses a recent JQuery, and I'd not seen one before. As claimed, it was easy to configure and worked right out of the box.
    - John Ogle, 3 months ago
    Flag review
    Was this helpful? Yes No

Starting from $ 9.99

View Pricing 14 days money-back guarantee