menu

SiteGenesis / Server-side JS / Module: controllers/StoreInventory

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.

Source:

(inner) getPreferredStore()

Gets the preferred store from the session.

Source:

(inner) getProductLineItem()

Assumes that the pid refers to a product line item instead of a product object for determining a product's availability.

Source:

(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.

Source:
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.

Source:
Returns:

The localized message.

Type
String

(inner) getZipCode()

Gets the users zip code from the session.

Source:

(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

Source:

(inner) lookupByZipCode()

Looks up stores based on the zipcode given and the site prefernces that refer to the radius and units of distance.

Source:

(inner) setPreferredStore()

Sets the preferred store for the session.

Source:

(inner) setStore()

Sets the store for a given line item.

Source:

(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.

Source:

(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
Source:

(inner) setZipCode()

Sets the users zip code for at the session.

Source:

(inner) setZipCodeCore()

Calls the showZipCode function.

Source:

(inner) showAvailableStores()

Creates a HashMap with store information for all stores where a product is available for in-store pickup.

Source:

(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.

Source:

(inner) showZipCode()

Renders the zip codes if the richUI cartridge is not in the path.

Source: