Controller for in-store functionality that is mostly used on the Product Detail Page. Note:core functions are used when the UI cartridge is not in the cartridge path.
- Source:
- To Do:
-
- Simplify the logic, there is no need to return the stores as JSON to render them in the client
Members
(static) CartSetZipCodeCore
- Source:
- See:
-
- module:controllers/StoreInventory~CartSetZipCodeCore
(static) GetPreferredStore
- Source:
- See:
-
- module:controllers/StoreInventory~GetPreferredStore
(static) GetZipCode
- Source:
- See:
-
- module:controllers/StoreInventory~GetZipCode
(static) Inventory
- Source:
- See:
-
- module:controllers/StoreInventory~Inventory
(static) SetPreferredStore
- Source:
- See:
-
- module:controllers/StoreInventory~SetPreferredStore
(static) SetStore
- Source:
- See:
-
- module:controllers/StoreInventory~SetStore
(static) SetStoreCore
- Source:
- See:
-
- module:controllers/StoreInventory~SetStoreCore
(static) SetZipCode
- Source:
- See:
-
- module:controllers/StoreInventory~SetZipCode
(static) SetZipCodeCore
- Source:
- See:
-
- module:controllers/StoreInventory~SetZipCodeCore
(static) ShowAvailableStores
- Source:
- See:
-
- module:controllers/StoreInventory~ShowAvailableStores
(static) ShowSelectedStoreCore
- Source:
- See:
-
- module:controllers/StoreInventory~ShowSelectedStoreCore
Methods
(inner) cartSetZipCodeCore()
Calls the setZipCodeCore to set the zip code. If the session does not have a custom.zipcode property, calls the showAvailableStores function.
(inner) getPreferredStore()
Gets the preferred store from the session.
(inner) getProductLineItem()
Assumes that the pid refers to a product line item instead of a product object for determining a product's availability.
(inner) getStoreAvailabilityMap(stores, product, productLineItem) → {dw.util.HashMap}
Gets store availability for the given product.
Parameters:
Name | Type | Description |
---|---|---|
stores |
dw.util.Collection |
The stores. |
product |
dw.catalog.Product |
The product to get the availability for. |
productLineItem |
dw.order.ProductLineItem |
The line item for the product. |
Returns:
The availability map.
- Type
- dw.util.HashMap
(inner) getStoreAvailabilityMessage(store, product) → {String}
Get the availability message for a given store and product.
Parameters:
Name | Type | Description |
---|---|---|
store |
dw.catalog.Store |
The store. |
product |
dw.catalog.Product |
The product. |
Returns:
The localized message.
- Type
- String
(inner) getZipCode()
Gets the users zip code from the session.
(inner) inventory()
Gets a list of stores with the given product, or product line item's availability to sell (requires rich_UI cartridge). If the storeID is not set it will be set within the session object. Renders a JSON object.
Sample URL to call ....Stores-Inventory?pid=2239622&zipCode=01803
(inner) lookupByZipCode()
Looks up stores based on the zipcode given and the site prefernces that refer to the radius and units of distance.
(inner) setPreferredStore()
Sets the preferred store for the session.
(inner) setStore()
Sets the store for a given line item.
(inner) setStoreCore()
Uses the httpParameter map plid, storeid, and storepickup parameters to set the store and its inventory list for the product line item. If this results in an error, calls the Cart Controller Show function. If not, then it removes any empty shipments, adds the storeid to the session custom properties and calls the Cart Controller Show function.
(inner) setStoreInLineItem(basket, liUUID, storeId, storepickup)
Sets the store and its inventory list for the given line item.
Parameters:
Name | Type | Description |
---|---|---|
basket |
dw.order.Basket |
The current basket. |
liUUID |
String |
The UUID of the line item. |
storeId |
String |
The ID of the store. |
storepickup |
String |
(inner) setZipCode()
Sets the users zip code for at the session.
(inner) setZipCodeCore()
Calls the showZipCode function.
(inner) showAvailableStores()
Creates a HashMap with store information for all stores where a product is available for in-store pickup.
(inner) showSelectedStoreCore()
Identifies the store selected for in-store pickup and renders selected store (storelocator/storepickup/coreshowselectedstore template). If the httpParameter map does not have a storeId parameter, calls the showSetStore function.
- Source:
- To Do:
-
- - Is this outdated?
(inner) showSetStore()
Renders the page that displays the set of stores where a product item is in stock (storelocator/storepickup/coresetstore template). If the httpParameter map does not have a storeId parameter, calls the showZipCode function.
(inner) showZipCode()
Renders the zip codes if the richUI cartridge is not in the path.