Ajax Stock Store Locator

This section describes the methods available within the "Store Locator" family of Ajax methods. Using these methods you can access stores and view their stock levels.

The intention of this article is to give the reader detailed information about how and where they can get information from Store Locator.

searchByBasket

Permission Required: None

Method Call: /ajax/Ajax_Frontend_Store_Locator/searchByBasket

Aurora Demo Example URL: http://www.aurorademo.co.uk/basket/

🚧

The Store Locator is used when selecting one of either the "Pay & Collect" or "Reserve & Collect" shipping options to select a store for collection.

Aurora Demo Example:

  • templates/example.com/store-finder/search-by-basket-store-list.html

📘

The searchByBasket method allows you to search for nearby stores using the contents of the visitor's basket to check stock availability (in the returned stores).

Request Parameters

VariableValuesRequiredDescription
store_idIntegerNoThe internal ID Aurora uses to uniquely identify a store location.
internal_store_numberStringNoThe internal store number.
quantityIntegerNoQuantity of the product which needs to be checked.
postcodeStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedPostcode used for the search.
searchStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedSearch term for the search.
countryStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedSearch by country.
country_idStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedInternal country ID.
longitudeFloatOne of Postcode, Search, Country, Country_id or Long & Lat must be providedThe longitude to use for the ‘centre’ of the search.

Not supported.
latitudeFloatOne of Postcode, Search, Country, Country_id or Long & Lat must be providedThe latitude to use for the ‘centre’ of the search.

Not supported.
template_nameStringNoThis will be the name of the Front-end Template that the requester would like to use. Example: search-by-basket-store-list.html. This template will only be searched for in the store-finder directory.

If no template name is provided, then the data will be returned as a JSON array.
service_typerc | ccNoThis allows the requester to stipulate which services it is attempting to search. It will accept a comma-delimited string of values.

Note: If this value is not provided then Aurora will simply check all configured/enabled services (as it does right now).

This setting is not supported by all 3rd party providers and so its behaviour with any one specific provider should be checked on a case-by-case basis.
dont_check_stock1NoThis parameter disables the store stock checks that are performed by some 3rd Party services and needs to be passed for all pages that are using the store locator and do not need to make a stock check.

Response Variables

VariableValuesDescription
storesArrayAll the information for the stores.

Only one of ‘html’ or ‘stores’ will be provided (not both), based on the presence of the "template_name" request parameter.
stores.idIntegerThe Internal ID used to uniquely identify this Store.
stores.typeStringThis indicates whether or not the Store is an actual physical store.
stores.nameStringThe name of the Store.
stores.address_1StringThe first line of the Store’s address.
stores.address_2StringThe second line of the Store’s address.
stores.townStringThe town from the Store’s address (if available).
stores.countyStringThe county from the Store’s address (if available).
stores.country_idIntegerThe Internal ID used by Aurora to uniquely identify the country from the Store’s address.
stores.postcodeStringThe postcode from the Store’s address.
stores.filenameStringThe ‘URL safe’ name for the Store.
stores.opening_hoursStringThe opening hours as described in Aurora (or the 3rd Party Service Provider).
stores.collect_in_storeIntegerCan this store accept orders for click and collect?
stores.reserve_and_collectIntegerCan this store accept orders for reserve and collect?
stores.telephoneStringThe telephone number for the Store.
stores.latFloatThe latitude value for the Stores location (if available).
stores.lngFloatThe longitude value for the Stores location (if available).
stores.fascia_store_codeString
stores.store_fasciaString
stores.distanceFloatThe number of miles from the ‘centre’ of the search.
stores.next_collection_timeIntegerThe next time this store will receive a collection, as a Unix Timestamp.
stores.next_collection_stringStringThe next time this store will receive a collection, as a date string.
stores.shipping_chargeFloatThe cost that will be charged for using this Store for the selected shipping method (if applicable).
stores.urlStringThis URL for the Aurora Store.
stores.productsArrayAn array of Product SKU’s and available stock levels for each product at said store.
stores.products.skuStringThe Aurora Product/Variation Reference for the Product/Variation in question.
stores.products.product_idIntegerThe Internal Aurora ID used to Uniquely identify a product in Aurora.
stores.products.store_stockIntegerThe stock available at this Store, for use with Reserve and Collect.
stores.products.basket_idIntegerThe Internal Aurora ID used to Uniquely identify a line in the current visitor’s basket.
total_storesIntegerThe number of Stores returned.
htmlStringThis will be the merged data, resulting from the use of the Front-end Template stipulated in the Ajax request variable called template_name.

Only one of ‘html’ or ‘stores’ will be provided (not both), based on the presence of the "template_name" request parameter.

Template Variables

👍

For more detail on what variables are available to you within the Templates used by these Ajax Endpoints, please see the Store Locator - Template Variables Support Article.

searchByProduct

Permission Required: None

Method Call: /ajax/Ajax_Frontend_Store_Locator/searchByProduct

Aurora Demo Example URL: https://demo.auroracommerce.com/00100023945/00100023945

Aurora Demo Example:

  • templates/example.com/store-finder/search-by-product-store-list.tpl.html
  • templates/example.com/_js/productdetails.js
  • templates/example.com/_js/product-details-common.js
  • templates/example.com/products/details.tpl.html

See the following UI on the URL provided above that demonstrates this feature.

📘

This endpoint allows you to check the stock availability of a specific product (or variation thereof, e.g. a specific size of a particular dress) for stores nearby the specified location (e.g. postcode or town name).

Request Parameters

VariableValuesRequiredDescription
product_idIntegerOne of Product or Variation ID or Reference must be provided.The Internal ID Aurora uses to uniquely identify a product.
variation_idIntegerOne of Product or Variation ID or Reference must be provided.The Internal ID Aurora uses to uniquely identify a product variation.
product_referenceStringOne of Product or Variation ID or Reference must be provided.The Product Reference/SKU Aurora uses to uniquely identify a product.
variation_referenceStringOne of Product or Variation ID or Reference must be provided.The Product Reference/SKU Aurora uses to uniquely identify a product variation.
store_idIntegerNoThe Internal ID Aurora uses to uniquely identify a store location.
internal_store_numberStringNoThe internal store number.
quantityIntegerNoQuantity of the product which needs to be checked.
postcodeStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedPost code used for the search.
searchStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedSearch term for the search. The term can be used with longitude and latitude coordinates. Example value for search:
latitude,longitude
countryStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedSearch by country.
country_idStringOne of Postcode, Search, Country, Country_id or Long & Lat must be providedInternal country id.
longitudeFloatOne of Postcode, Search, Country, Country_id or Long & Lat must be providedThe longitude to use for the ‘centre’ of the search.

Not supported.
latitudeFloatOne of Postcode, Search, Country, Country_id or Long & Lat must be providedThe latitude to use for the ‘centre’ of the search.

Not supported.
template_nameStringNoThis will be the name of the Front-end Template that the requestor would like to use. Example: search-by-basket-store-list.html. This template will be only searched for in the store-finder directory.

If no template name is provided then the data will be returned as a JSON array.
service_typerc | ccNoThis allows the requestor to stipulate which services it is attempting to search. It will accept a comma-delimited string of values.

Note: If this value is not provided then Aurora will simply check all configured/enabled services (as it does right now).

This setting is not supported by all 3rd party providers and so its behaviour with any one specific provider should be checked on a case-by-case basis.
dont_check_stock1NoThis parameter disables the store stock checks that are performed by some 3rd Party services and needs to be passed for all pages that are using the store locator and do not need to make a stock check.

Response Variables

VariableValuesDescription
storesArrayAll the information for the stores.

Only one of ‘html’ or ‘stores’ will be provided (not both), based on the presence of the "template_name" request parameter.
stores.idIntegerThe Internal ID used to uniquely identify this Store.
stores.typeStringThis indicates whether or not the Store is an actual physical store.
stores.nameStringThe name of the Store.
stores.address_1StringThe first line of the Store’s address.
stores.address_2StringThe second line of the Store’s address.
stores.townStringThe town from the Store’s address (if available).
stores.countyStringThe county from the Store’s address (if available).
stores.country_idIntegerThe Internal ID used by Aurora to uniquely identify the country from the Store’s address.
stores.postcodeStringThe postcode from the Store’s address.
stores.filenameStringThe ‘URL safe’ name for the Store.
stores.opening_hoursStringThe opening hours as described in Aurora (or the 3rd Party Service Provider).
stores.collect_in_storeIntegerCan this store accept orders for click and collect?
stores.reserve_and_collectIntegerCan this store accept orders for reserve and collect?
stores.telephoneStringThe telephone number for the Store.
stores.latFloatThe latitude value for the Stores location (if available).
stores.lngFloatThe longitude value for the Stores location (if available).
stores.fascia_store_codeString
stores.store_fasciaString
stores.distanceFloatThe number of miles from the ‘centre’ of the search.
stores.next_collection_timeIntegerThe next time this store will receive a collection, as a Unix Timestamp.
stores.next_collection_stringStringThe next time this store will receive a collection, as a date string.
stores.shipping_chargeFloatThe cost that will be charged for using this Store for the selected shipping method (if applicable).
stores.urlStringThis URL for the Aurora Store.
stores.productsArrayAn array of Product SKU’s and available stock levels for each product at said store.
stores.products.skuStringThe Aurora Product/Variation Reference for the Product/Variation in question.
stores.products.product_idIntegerThe Internal Aurora ID used to Uniquely identify a product in Aurora.
stores.products.store_stockIntegerThe stock available at this Store, for use with Reserve and Collect.
stores.products.basket_idIntegerThe Internal Aurora ID used to Uniquely identify a line in the current visitor’s basket.
total_storesIntegerThe number of Stores returned.
htmlStringThis will be the merged data, resulting from the use of the Front-end Template stipulated in the Ajax request variable called template_name.

Only one of ‘html’ or ‘stores’ will be provided (not both), based on the presence of the "template_name" request parameter.

Template Variables

👍

For more detail on what variables are available to you within the Templates used by these Ajax Endpoints, please see the Store Locator - Template Variables Support Article.