Technical documentation - Availability settings

Availability may be displayed as a text, as an icon and actual stock level. Text and icon may be changed based on level indicating e.g. low stock.

Overview

Prices may be displayed with or without icon, with or without text and with and without stock level. The icon and text may also be changed depeding on stock level to indicate that a part is getting low on stock. Warehouse name may also be displayed.

 

 

Limits for when a part is getting low in stock can be set in four levels:

  • Level 1. Out of stock

  • Level 2. Very low on stock

  • Level 3. Low on stock

  • Level 4. Available

The actual limits in terms of number of available may be defined in a configuration, or included in an API response. Returning a level (1-4) in the API may handle the situation that different parts are high runners so that when there are 100 on stock that may actually mean very low on stock, while another part with 5 in stock is plenty.

Configuration

Providers for Availability contains some settings for availability. See separate articles under Order Process, depending on what providers are used:

What is shown on availability is defined in profile.config by using the tag StockDisplayModes located in the root of profile.config.

<!-- Will display an icon and a text (e.g Out of stock or Available) --> <StockDisplayMode>Icon AvailabilityText<StockDisplayMode>

Mode

Description

Mode

Description

None

Availability will not be displayed.

Text

 

Quantity

Stock level will be displayed. If level is 0 Out of stock will be displayed.

Icon

Icon for availability will be displayed, X for out of stock and check for available. Depending on stock level different colours and icons may be used by stying in CSS.

AvailabilityText

A text will be displayed, e.g Out of stock or Available.

LeadTime

Delivery date or days to deliver. This option requires custom providers.

Version 4.3 to version 5.0

Warehouse name is shown by default if it is available. To hide warehouse name, use css rules.

Availability text and icon is controlled by the AvailabilitySettings tag.

<AvailabilitySettings> <AvailabilityLevelSettings> <!-- Use this setting if part’s availability should determine icon --> <PartQuantity>0</PartQuantity> <!-- Use this setting if part’s level setting should determine icon --> <LevelValue>0</LevelValue> <!-- Ensure to add this for the first level --> <LevelType>NotAvailable</LevelType> <!-- Key text to use --> <KeyText>NotAvailable</KeyText> <!-- Icon may be ok (a check mark) or remove (an X) --> <IconName>remove</IconName> </AvailabilityLevelSettings> <AvailabilityLevelSettings> <PartQuantity>1</PartQuantity> <LevelValue>1</LevelValue> <LevelType>Available</LevelType> <KeyText>Available</KeyText> <IconName>ok</IconName> </AvailabilityLevelSettings> </AvailabilitySettings>

Version 5.1 and later

In version 5.1 and later the availability setting is moved to reside inside the OrderManager. It is possible to define several availability levels and how they should behave.

Attribute

Usage

Options

Attribute

Usage

Options

level-value

Trigger. Use level value as a trigger for this setting. If level value of the availability is this value, this setting will be used.

Typically used as 0 = not available, 1 as low availability and 2 as high availability. Level-value can be returned by the availability provider.

int

part-quantity

Trigger. Use part’s availability as a trigger for this setting. If availability of the part is equal to or lower than part-quantity this setting will be used.

int

class

Css class which will be applied to the availability so that it can be styled by css rules.

text

icon

Which icon should be used, or if no icon should be used. If icon not added as attribute no icon will show.

key-text

The text that will display for this stock level. If key-text not added as attribute no text will show.

text

level-type

 

Available, NotAvailable

<OrderManager> <OrderManager> <AvailabilitySettings> <AvailabilityLevelSettings level-value="0" level-type="NotAvailable" key-text="NoneAvailable" class="red" icon="remove" /> <AvailabilityLevelSettings part-quantity="1" level-value="1" level-type="Available" key-text="Available" class="green" icon="ok" /> </AvailabilitySettings> </OrderManager> </OrderManager>