Access new field from frontend - Nop.Core.Domain.Catalog - ProductVariant

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 Jahre weitere
Hi,

as I need a custom field for the ProductVariant I add a field to the table and add it to the class.
Editing the field in the backend works fine and is stored at the table.
The matter is that I don't know how to access the field from the frontend ...?
_ProductVariantLine.cshtml access ProductDetailsModel.ProductVariantModel to get data from but this is the end of my race :-)

I tried something like at my field "public string Link { get; set; }" to "public partial class ProductVariantModel : BaseNopEntityModel" but get no result - Link is the name of my field.

I'm sorry I'm a novice with MVC and not such familar with OOP but as store the value works fine I think there're only few steps missing, right?

Thanks

Andre
11 Jahre weitere
You also need to modify the model \src\Presentation\Nop.Web\Models\Catalog\ProductDetailsModel.cs
and the controller src\Presentation\Nop.Web\Controllers\CatalogController.cs
  here's one spot, but you may need to do others depending on you requirements
  protected ProductDetailsModel.ProductVariantModel PrepareProductVariantModel(...
11 Jahre weitere
Thanks for your reply.


You're right - src\Presentation\Nop.Web\Controllers\CatalogController.cs was missing ...

Now it works fine :-)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.