I am new to NopCommerce v2.4 and wondering where do I write my code (by creating new model in admin or nop.web section)
I spent plenty of time for delving into this problem' depths. I can summarize the solution as follows:
Create The Entity Class (e.g Entity.cs)
Path : Nop/Core/Domain/Entity.cs
Create The Mapping Class (e.g EntityMap.cs)
Path : Nop/Data/Mapping/EntityMap.cs
Create a Model for MVC (e.g EntityModel.cs)
Path : Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs
Create a validator for model (e.g EntityValidator.cs)
Path : Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs
Create A Mapping Configuration On AutoMapperStartupTask.cs for Entity and Model
Path : Nop/Admin/Infrastructure OR Nop/Web/Infrastructure
Apply Mapping between Model and Entity on MappingExtensions.cs
Path : Nop/Admin OR Nop/Web
Create a service class and service interface (e.g EntityService.cs , IEntityService.cs)
Path : Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs
Register service for dependency injection
Path : Nop/Web/Framework/DependencyRegistrar.cs
Finally Create Controller and View for given model
as Nop Commerce uses the very first release of MVC3, database migration is not supported and you must make changes to database tables by hand. Because MVC code-first must drop and recreate your database for reflecting changes to your database.
If you want to get to more detail in any step, let me know - I can describe each step in detail. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With