List stores by zip code

Name
listStores ($startresultno, $resultperpage, $sortby)
Example
<html>

<head></head>

<body>

<?php

require_once(‘eMaxApi.class.php’);

$emax = new eMaxClient;

$emax->zipcode = “94087″;   // mandatory

$emax->miles = 5;  // optional

$emax->city = “Sunnyvale”;  // optional

$emax->state = “CA”;  // optional

$emax->country = “USA”;  // optional

$emax->store = “ABC store”;  // optional

$emax->product = “T-shirt”; // optional

$emax->category = “Apparel”;  // optional

$emaxResults = $emax->listStores($startresultno,$resultperpage,$sortby);

?>

</body>

</html>
Result
Return List of Stores available in specific search.
Array
(
[0] => Array
(
[STORENAME] => Store Name
[STOREID] => Store ID (Use in getStoreDetails function)
[DISTANCE] => Distance from searched Zipcode
[ZIPCODE] => Store Zipcode
[SUBURB] => Store Suburb (Only return for Australian store)
[LATITUDE] => Store Latitude
[LONGITUDE] => Store Longitude
[ADDRESS] => Store Address
[CITY] => Store City
[STATE] => Store State
[COUNTRY] => Store Country
[TELEPHONE] => Store Telephone
[FAX] => Store Fax
[EMAIL] => Store Email
[WEBSITE] => Store Website
[MAPURL] => Store Map URL
[PICTURE] => Store Picture
[VIDEO] => Store Video
[CATEGORIES] => Store Categories
[PRODUCTS] => Store Products
[CustomFieldName1] => Custom Field Value 1
[CustomFieldName2] => Custom Field Value 2
)
}
Description
Variables: 

emax->zipcode (required)
Type (String), Value (Any zip code from USA, UK, Australia, Canada).
- The zip code for which you want to search the stores. The value has to be a valid zip code from the giving countries otherwise invalid zip code exception is thrown.

emax->miles (optional)
Type (Integer), Value (Number).
- Set the miles variable if you want API to find stores within radius(miles) of the zip code set above. If this variable is not set all the stores are returned in order of distance from the zip code specified. We recommend to use this variable if you have large number of stores concentrated in an area. Smaller the value of emax->miles faster will be the response.

emax->city (optional)
Type (String), Value (Valid name of city in which there is at least one of your stores exists.)
- emax->city makes listStores to return stores in order of distance from zip code for the specified city defined in emax->city.

emax->state (optional)
Type (String), Value (Valid name of state in which there is at least one of your stores exists.)
- emax->state makes listStores to return stores in order of distance from zip code for the specified state defined in emax->state.

emax->country (optional)
Type (String), Value (Valid name of country in which there is at least one of your stores exists.)
- emax->country makes listStores to return stores in order of distance from zip code for the specified country defined in emax->country.

emax->store (optional)
Type (String), Value (Name of the store or part of name of the store.)
- emax->stores makes listStores to return stores in order of distance from zip code having the value of emax->store in the name of the store field.

emax->product (optional)
Type (String), Value (Name of the product or part of name of the product.)
- emax->product makes listStores to return those stores in order of distance from zip code which have product name specified in emax->product.

emax->category (optional)
Type (String), Value (Name of the category of the store.)
- emax->product makes listStores to return those stores in order of distance from zip code which are in specified category. (Category must be set in database before using this variable.)

Parameters:

$startresultno (optional)
Type (Integer), Default (0) Value (Count from which the function should start returning stores)
Use this parameter if you want to paginate your result. Setting this arguments tells function to start returning the result from the specified count.

$resultperpage (optional)
Type (Integer), Default (10) Value (Number of stores to return)
Use this parameter if you want to paginate your result. Setting this arguments tells function to only return as many result as specified in this parameter.

$sortby (optional)
Type (String), Default (“DISTANCE”) Value (“STORENAME”, “ADDRESS”, “CITY”, “ZIPCODE”, “DISTANCE”)
Use this parameter to sort the result on the given parameters. Sorting is only supported on specified values.
Summary
Function when called upon, An instance of eMaxAPI object returns an array of stores. Function takes store search criteria variables to list stores.
eMax Store locator software
eMax Store locator software