The GeoLocatorFormHandler
features two handle method:
HandleLocateItems
handles querying for items based on a provided input locationHandleCurrentResultPageNum
displays result pages. This method requires that theenableCountQuery
property is set totrue
and thathandleLocateItems
has been called to generate results to page through.
Commerce also includes a geo-location droplet. Refer to the ATG Commerce Guide to Setting Up a Store for information on this droplet. Use the form handler when user input is required, for example a customer providing a postal code. Use the droplet when user input can be inferred, such as when location information is available in the browser.
The GeoLocatorFormHandler
includes the following input properties. For additional information, refer to the ATG Platform API Reference.
Location Properties
Location properties provide a centralized location from which to search. Note that address
, postalCode
, city
and state
require a GeoLocatorProvider
that supports these methods:
Property Name | Type | Description |
---|---|---|
| String | Free-form address used to find a location. |
| String | When provided with |
| String | When provided with |
| String | Postal code used to find a location. |
| double | If another input method, such as |
| double | If another input method, such as |
| String | If provided along with |
| String | If provided along with |
Site Filtering Properties
Site filtering properties are used when the items being located have a site membership property. By default, filtering occurs on the current site, but the search can be filtered to include specific sites.
Property Name | Type | Description |
---|---|---|
| Collection | IDs by which to constrain the results. |
| String | Site scope by which to constrain the results. A site scope can be:
|
| Runs the filter on all sites, including inactive sites. | |
| Runs the filter on all sites, including disabled sites. |
Distance Properties
Distance properties indicate the range of the returned results. Only items within the provided distance will be in the result set. Note that by default, distance is measured in meters.
Property Name | Type | Description |
---|---|---|
| double | Items within this distance in meters are returned. |
| String | The unit of measure of the distance. |
| double | The maximum allowed search distance, measured in meters. A value of -1 searches all items. |
Redirection Properties
Redirection properties are available to set URLs for conditional redirection. If a URL parameter is not available, redirection will not occur:
Property Name | Type | Description |
---|---|---|
| String | The URL that is used if no errors are encountered. |
| String | The URL that is used if errors occur. |
| String | The URL used when the |
Results Properties
Results properties are available once the search has been run:
Property Name | Type | Description |
---|---|---|
| Collection | A collection of repository items returned by the |
| String | Returns the results sorted by item type. |
Page Navigation Properties
Page navigation properties allow you to create controls that navigate between pages of results. The following properties can be used to create navigation buttons on the results page:
Property Name | Type | Description |
---|---|---|
| Boolean | If |
| int | Maximum number of results to display for a page of results. |
| int | The number of results returned by the query. |
| int | The ending index to display based on the current page. |
| int | The starting index to display based on the current page. |
| int | The current page of results being displayed (1-based). |
| int | The number of pages of results. |
| int | The index of the first record of the result set that is displayed within the current page. |
| int | The index of the last record of the results set that is displayed on the current page. |
The following properties determine the managers, services and types of items to use:
Property Name | Type | Description |
---|---|---|
|
| The |
|
| The |
|
| Identifies the |
|
| The |
| String | The item type to search for. Must be a valid item-descriptor for the repository used by the |