Database Reference
In-Depth Information
$row->distanceToLocation =
self::distance(floatval($mappedUserLocation["lat"]),
floatval($mappedUserLocation["lon"]),
floatval($row["lat"]),
floatval($row["lon"]),
"M") . " Miles away";
}
return $result;
}
Locations with Product
To search for products nearby, as shown in Figure
8-17
, the application makes use of an autosuggest AJAX request,
which ultimately calls the search method in the Product service class. The method, shown in Listing 8-42, returns
an array of objects to the product field in the search form and applies the selected product's
productNodeId
to the
subsequent location search.
Figure 8-17.
Searching for Products in stock at Locations within a certain distance of the User location