# Lot View & Configuration

In this section we show how the lot numbers can be viewed and configured on the product level. Lot numbers (see Lot numbers are viewed on the product level in SellStack Admin image) for a particular product can be viewed in the product editing form by clicking on the Lot numbers tab. This is the best view for filtering lot numbers by product and is equivalent to the lot numbers view in Dynamics 365. This view gives a quick overview of the lot inventory (total vs reserved quantity). Admins can also see if the lot number is enabled or disabled. Only enabled lot numbers can be purchased in the shop. 'Details' button redirects to the lot page with general information. The product details section of the product editing form is a configuration point for several lot-based parameters. Lot allocation method, lot visibility, and lot attributes filtering are all parameters that can be configured on the product level. Product display in the shop depends on these parameters (see Products in the shop chapter).

Lot numbers are viewed on the product level in SellStack Admin

![Lot numbers are viewed on the product level in SellStack Admin](https://3198953399-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIzoTxOCA4BkOMmldqegW%2Fuploads%2Fgit-blob-355d50212dda68733a3bcf8c880622b207d76304%2Fimage90.png?alt=media)

The lot allocation method defines the strategy used to assign lot numbers when a product is purchased. Currently, the following allocation methods are available: FAFO, FEFO, FIFO, FAFO (exclude tiny), FEFO (exclude tiny), FIFO (exclude tiny), and user-selected.

The **FAFO** method is the simplest and most basic. It allocates lot numbers based on the time they were imported into SellStack, with the oldest available lots allocated first.

The **FEFO** method orders lot numbers by their expiration date in ascending order, meaning the lot with the earliest expiration date is allocated first.

The **FIFO** method is currently the most complex, as it combines both harvest and manufacture dates in the sorting process. The harvest date has priority, while the manufacture date is used only when the harvest date is unknown or the values are identical.

The “exclude tiny” variants (FAFO, FEFO, FIFO) follow the same allocation logic as their standard counterparts but omit lot numbers with very small available quantities. The minimum quantity threshold is configurable via the LOT\_LIMIT environment variable.

In these six methods, lot allocation occurs automatically in the background - the customer simply adds a product to the cart, and the system determines which lot will be added.

The seventh method, **user-selected**, differs logically from the others and allows customers to select and purchase individual lot numbers. When this method is active, customers cannot add a product directly to the cart from the shop page. Instead of the “Add” button, a “View” button appears, linking to the product detail page (image Lot attribute filtering on the product detail page in SellStack Shop shows both cases).

Images Products grid view in SellStack Shop and Product detail page (version 1) in SellStack Shop illustrate how the page layout changes depending on the selected lot allocation method, as described above. Enabling the user-selected lot allocation method also disables lot attribute filtering.

The Lot visibility parameter controls whether lot numbers are displayed on the product detail page in the shop. When enabled, the lot list becomes visible. This does not mean that individual lot numbers can be purchased, as with the user-selected lot allocation method - lot numbers are only displayed with their attributes, without the "Add to Cart" button. In other words, the Lot visibility parameter provides a subset of the functionality offered by the user-selected lot allocation method. The user-selected method not only makes lot numbers visible but also allows customers to purchase individual lot numbers.

Of course, for lots to be visible, the product must have assigned lot numbers. A product without lot numbers is called a lot-agnostic product. It is also worth noting that only lot numbers with available inventory are displayed.

The Lot attributes filtering parameter controls the display of lot attribute filters at the product level. A Lot attribute must be enabled for filtering both in the lot attribute configuration (see next chapter) and at the product level. If activated for multiple products, all products share the same lot attribute filters - those enabled at the lot attribute level. It is not possible to have different lot attribute filters for different products.

Lot attribute filtering affects the product list view in the same way as the lot allocation method. When enabled, a "View" button is displayed instead of the "Add to Cart" button. This parameter is closely related to the user-selected lot allocation method, as enabling that method automatically disables lot attribute filtering. Image Lot attribute filtering on the product detail page in SellStack Shop shows an example of a product detail page when a lot attribute filter is active.

In addition to influencing how product pages are displayed, lot attribute filtering allows customers to control which lot numbers are added to their cart for a selected product. This feature works in combination with the FIFO, FEFO and FAFO lot allocation methods by prioritizing lot numbers whose attribute values match the selected filters. If the lot attribute filter cannot be applied - for instance, if no value is selected or there is insufficient inventory in the matching lots - the standard lot allocation method is applied.

Lot attribute filtering on the product detail page in SellStack Shop

![Lot attribute filtering on the product detail page in SellStack Shop](https://3198953399-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIzoTxOCA4BkOMmldqegW%2Fuploads%2Fgit-blob-4279f853790a3ed5b0f6c0f401b270ea3c66106a%2Fimage52.png?alt=media)
