Spire wrote:
The error is coz there is no productvariantmodel in ProductOverviewModel, You need to define all the partial classes within ProductOverviewModel inorder to use there properties, Currently ProductOverviewModel consist of ProductPriceModel , PictureModel , ProductSpecificationModel And there details are fetched through controller PrepareProductOverviewModels which is used by view to generate the required details . You have to define partial class in the productoverview model and get the value in controller which can be used by View.
I had arrived at that conclusion, but was unsure if I was on the correct path, but thank you for confirming I am going the right direction.
It really is a steep learning curve for me as not only am I a MVC novice I am in the VB camp, so C# code is not as easy to read as VB for me.
Thanks
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)