Low stock activity - mismatch between behavior and documentation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Not sure if this is worked as designed or a bug.

The documentation explains:

From the Low stock activity dropdown list, select the action to be taken when the stock quantity falls below the minimum stock quantity value.

When minimum stock quantity is 1,  falls below means when stock quantity will be under 0 (below 1)
However, the low stock activity is actived when stock quantity reaches the minimum stock quantity

Is this a bug or an error in the documentation?
3 years ago
Maybe both ;)

\nopC\src\Libraries\Nop.Services\Catalog\ProductService.cs
public virtual async Task<IPagedList<Product>> GetLowStockProductsAsync(int? vendorId = null, bool? loadPublishedOnly = true,
...
    //filter by products with stock quantity less than the minimum
    query = query.Where(product =>
        (product.UseMultipleWarehouses ? _productWarehouseInventoryRepository ...Sum(...)
            : product.StockQuantity) <= product.MinStockQuantity);

/// Applies the low stock activity to specified product by the total stock quantity/// </summary>
...
protected virtual async Task ApplyLowStockActivityAsync(Product product, int totalStock)
{
    var stockDec = product.MinStockQuantity >= totalStock;
    var stockInc = _catalogSettings.PublishBackProductWhenCancellingOrders && product.MinStockQuantity < totalStock;
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.