Skip to main content
Related API: This extension modifies the Get Price List operation.
This action occurs when determining the price list to use when looking up product pricing. Note that the action name is spelled “getPriceListHierachy”, not “getPriceListHierarchy”. This arc doesn’t always fire immediately after pushing a change. Sometimes you need to change something like logging in or logging out, changing a product, or just waiting 10 or 15 minutes. Additionally, if there is no default price list set in the tenant, this arc won’t fire. >
Action TypeEmbedded
Full Action IDembedded.commerce.catalog.storefront.products.getPriceListHierachy
Runs multiple custom functions?No

JavaScript File Structure

Action files share the following basic structure:
When you code the custom function for an action, you have access to two arguments: callback—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required). context—This argument provides the function access to relevant objects and methods that interface with Kibo eCommerce.

Context: PriceList

The methods and objects documented here are available to this action through the use of the context argument. Microservice Operation
This action corresponds to the microservice that gets a price list.

Get

context.get.priceListHierarchy()

Returns an array of the current price list hierarchy based on the context. Example:
This example further shows how this call could be used in the action file. In order to set a price list, you must pass an array of price lists as the second parameter of callback(), such as callback(null, [pricelist1, pricelist2, pricelist3, pricelist4]). A logged in user with a customer segment will have any customer segment specific pricelist codes in this array, while a guest user will just see the default. The following action file will attempt to locate a price list entry for the current product in pricelist1, and if it exists, it will set that as the effectivePricelist. If it fails, it will look for the entry in pricelist2, and set that as the effectivePriceList if it exists. Otherwise, it will continue to look at the next price list. A logged in user with a customer segment will have any customer segment specific pricelist codes in this array, while a guest user will just see the default.
For information about the properties in the response, refer to the REST API Help.

Context Objects Available to All Actions

apiContext

Accesses Kibo eCommerce tenant information. Example:

configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor. Example: