I'm pretty new to NopCommerce so I hope someone can give me some directions. I want to show the productvariant properties Weight, Length and Height to the customer on the productdetail page. I want to show them with my product specification so I did the follow:
Extended the ProductModel.cs with
public class ProductVariantPriceModel : BaseNopModel
{
public string OldPrice { get; set; }
public string Price { get; set; }
public string PriceWithDiscount { get; set; }
public decimal PriceValue { get; set; }
public decimal PriceWithDiscountValue { get; set; }
public bool CustomerEntersPrice { get; set; }
public bool CallForPrice { get; set; }
public int ProductVariantId { get; set; }
public bool HidePrices { get; set; }
public bool DynamicPriceUpdate { get; set; }
//added
public string YouSave { get; set; }
public string YouSavePercent { get; set; }
//@added
//add pve
public decimal Weight { get; set; }
public decimal Length { get; set; }
public decimal Width { get; set; }
public decimal Height { get; set; }
//@//added
}
Then I create a new partial View _ProductVariantSpecifications.cshtml
@model Nop.Web.Models.Catalog.ProductModel.ProductVariantModel.ProductVariantPriceModel
@using Nop.Web.Models.Catalog;
@using Nop.Core.Domain.Catalog;
@using Nop.Core.Infrastructure;
@using Nop.Core;
@using System.Text;
@using System.Globalization;
@using Nop.Web.Framework;
@using Nop.Services.Customers;
@using System.Text.RegularExpressions;
<div class="customspecifications">
<div class="productspec-list">
<div class="customspecifications">
<table class="grid" style="width: 100%; border: 0px">
<tr>
<td style="width: 30%;">
Lengte(cm)
</td>
<td style="width: 70%;">
@*@Model.Length;*@
</td>
</tr>
<tr>
<td style="width: 30%;">
Breedte(cm)
</td>
<td style="width: 70%;">
@* @Model.Width;*@
</td>
</tr>
<tr>
<td style="width: 30%;">
Hoogte(cm)
</td>
<td style="width: 70%;">
62222
</td>
</tr>
<tr>
<td style="width: 30%;">
Gewicht(kg)
</td>
<td style="width: 70%;">
3.2
</td>
</tr>
</table>
</div>
</div>
</div>
The problem is that the properties Length, weight etc in the model are empty. Where do I have to load these values in the model
Thanks