$wsStores module, you can access the shop’s configured stores and branches. Typical use cases are Click & Collect, store finder, and the display of stock levels in the store. In this section, you will learn how to load stores, manage the selected store, and display opening hours.
Module overview
Example / excerpt of$wsStores
ƒ() denotes a function.
Variables and methods overview
Templates
The $wsStores module is typically used on:- Store search pages (store finder)
- Product detail pages (availability in the store)
- Checkout pages (Click & Collect selection)
- Header/footer (display of the selected store)
Variables
$wsStores.selectedStore
Returns the store currently selected in the session. Isnull if no store has been selected.
Methods
$wsStores.loadAllStores()
Loads a list of all available stores. Signature$wsStores.loadAllStores()
Return valuearray - List of store maps.
Example that loads and displays all stores.
$wsStores.loadStore()
Loads a single store by its ID. Signature$wsStores.loadStore(storeId)
Return valuemap - Store map with all store data.
Example that loads a store.
By using the return data of
$wsStores.loadStore, various properties are available that can be used. Below is an overview of which properties are available.Properties of $wsStores.loadStoreActions
No actions are available for$wsStores.
