step-by-step tutorial for adding a new table to nopCommerce 2.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Can u tell me how add new table in nop commerce 2.3
12 years ago
[email protected] wrote:
Can u tell me how add new table in nop commerce 2.3


You should read through the developer documentation available at https://www.nopcommerce.com/documentation.aspx. This should give you enough information to start extending the nopCommerce framework.
12 years ago
we want adding updating and deleting and the user interface for same
12 years ago
[email protected] wrote:
we want adding updating and deleting and the user interface for same


There is no document that will give you a step-by-step of every type of development, but all the documents together will give you everything you need to know for extending the nopCommerce platform.
11 years ago
I spent plenty of time for delving into this problem' depths. I can summarize the solution as follows:

1. Create The Entity Class (e.g Entity.cs)

    Path : Nop/Core/Domain/Entity.cs

2. Create The Mapping Class (e.g EntityMap.cs)

    Path : Nop/Data/Mapping/EntityMap.cs

3. Create a Model for MVC (e.g EntityModel.cs)

    Path : Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs

4. Create a validator for model (e.g EntityValidator.cs)

    Path : Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs

5. Create A Mapping Configuration On AutoMapperStartupTask.cs for Entity and Model

    Path : Nop/Admin/Infrastructure OR Nop/Web/Infrastructure

6. Apply Mapping between Model and Entity on MappingExtensions.cs

    Path : Nop/Admin OR Nop/Web

7. Create a service class and service interface (e.g EntityService.cs , IEntityService.cs)

    Path : Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs

8. 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.
11 years ago
Hello nikunjclarion,

I am new in nopcommerce and first trying to learn the entity structure. I think if i learn the entity structure, the others will be very easy. Your list describing adding a column is very useful and actually very key points to learn the entity model in nopcommerce.

Can you explain each item more in detail? What does each item?

Thanks in advance

Ahmet KILIÇ
[email protected]
11 years ago
you should read Pro Asp.net MVC4.0(adam freeman) ebook for basic understanding of MVC Architecture and entity framework.
9 years ago
9.You need to register your custom service with <Nop.Web.Framework<DependencyRegistrar.cs
ex.  builder.RegisterType<EntityService>().As<IEntity>().InstancePerHttpRequest();
7 years ago
Open this path ~\Nop.Web.Framework and open DependencyRegistrar.cs and register your service and interface like this

// UserMaster
builder.RegisterType<EntityService>().As<IEntityService ().InstancePerLifetimeScope();

Create table in NopCommerce database and give name "Entity".
Note: Manually create table in database is necessary.

Finally create new controller and its View

If you want to get to more detail, Click here!https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=11&cad=rja&uact=8&ved=0ahUKEwiNpYaezPXOAhWKsI8KHSc2Cxk4ChAWCBwwAA&url=http%3A%2F%2Fwww.lateshtclick.com%2Fblogpost%2Fhow-to-add-new-tables-to-nopcommerce&usg=AFQjCNFme_dRu4dwVUKDRFqcgMxvDp_r9Q&sig2=uSiyZ9uSZf-TI6gszBDCrQ
4 years ago
We need more examples like this, which detail how to adopt NopCommerce in the most agile and easy way, not all of us are experts like the ones who created this infrastructure.

thanks a lot

Domingo Tapia.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.