Hi,
I need to be pointed in the right direction - I am pretty new to MVC and browsing through NopCommerce can be a bit overwhelming at first.
I have a table with additional information about products. I want to present this info in non standard way on the product page. I figured that the best way will be to insert the additional functionliaty via Html.Action. I imagine it would look like this:
@Html.Action("AdditionalProductInfo", "Catalog", new {productId = Model.Id})
All right next step I need to add appropriate view and ChildAction to the CatalogController.cs
[ChildActionOnly]
public ActionResult AdditionalProductInfo (int productId)
{
//what goes here?
}
I have created a new class in Nop.Core.Domain and even a mapping in Nop.Data.Mapping. Bang! (more or less) and I have a class in my DB :-).
This is what I know. Now comes the question :-)
How do I access the data from my table?
Do I need to obtain a reference to existing (already initialized) DbContext class to run some LINQ queries? Or do I need to create one from scratch? Or maybe I need to do something totally different?
Any help or suggestions appreciated!
Filip