Commerce includes several classes that manage location information for your stores. The Coordinate
class stores latitude and longitude information. The CoordinateManager
provides methods for determining store locations so that customers can select an appropriate location for pick-up. The getNearest()
method takes a pair of coordinates (either as a repositoryItem
or as a Coordinate
object) and a radius in meters and returns all locations within that radius. The results are ordered by distance from the provided coordinates.
Note: These coordinates are intended for providing local information, and are estimates only.
To adjust the location, you can use one of the following methods:
addMetersToLatitude
addMetersToLongitude
getDistanceBetweenCoordinates