nopCommerce Adding Stock Availability to Search Results

...this will work for Category results as well.

See this note in nopCommerce forums

Add to \Nop.Web\Extensions\ControllerExtensions.cs
...find the PrepareProductOverviewModels function.

Below the var model = ProductOverviewModel{...
section add model.CustomProperties.Add("stockQuantity", product.StockQuantity);

This will add a custom property to the ProductOverviewModel and since you are already looping through the products returned there won't be a significant performance hit.

Then find the \Nop.Web\Views\Shared\_ProductBox.cshtml ...or other equivalent file if you have already modify this one and swapped it out.

...add below code to the Product Box view where you want it to show up.
      @if (Model.CustomProperties.ContainsKey("stockQuantity"))
            {
               

                    Qty:
                    @Model.CustomProperties["stockQuantity"]
               
            }

Then recompile the Nop.Web project and move the Nop.Web.dll to the bin folder for test or production.  Also move the _ProductBox.cshtml file to test or production as well.  If you only move the Nop.Web.dll this will not crash the website.