Just try this, i have not tested it , just a guess :
Add this line to PrepareProductOverviewModels [Nope.WebControllers.CatalogController]
var quantity = productVariant.AllowedQuantities;
after this line
var productVariant = _priceCalculationService.GetProductVariantWithMinimalPrice(productVariants, _workContext.CurrentCustomer, true, int.MaxValue, out minimalPrice); //line248
Now add this line in the ProductOverviewModel
public string quantity { get; set; } it should be included in the partial class
public partial class ProductPriceModel : BaseNopModel
Now call quantity in the _ProductBox.cshtml
like:
@Html.Raw(Model.ProductPrice.quantity)
Hi
Well as you posted the above code I had just worked out that I may be able to get to the Stock Qty by using this line in the productVariant.StockQuantity; at the line in the code u suggested.
However I was still trying to work out how how to get that in to the view, so I followed the code u suggested with a couple of minor changes
priceModel.StockQty = productVariant.StockQuantity; instead of
var quantity = productVariant.AllowedQuantities;
public int StockQty { get; set; } instead of public string quantity { get; set; }
and @Model.ProductPrice.StockQty instead of
@Html.Raw(Model.ProductPrice.quantity)
and it worked :) thank you again for your time and patience, I am begining to learn a little C# and MVC. :)
Thanks
Glad to see that it worked out for you , make sure if you have multiple variants for product then you have to use a loop.
Thanks