New Product Fields

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I need to add few extra fields to Product Table in database.

1. ISBN
2. BarCode
3. Author


I have been searching the forum but couldn't find a way to do that :(

Can someone help me please.
14 years ago
It's a bit more involved than that.

First you need to add the fields to your database tables, which would be done with SSMS or via the web control panel if you are in a hosted solution.

Then you would need to modify the code in nopCommerce to recognize the new columns (fields). This would involve any screens that would use the new data along with all data access routines to load and save the new data.
14 years ago
Here are the steps.

Pre-1. Make copies of everything you are about to change so you can revert back once you are half way through and decide it is too much work to carry on.

1. Add the fields to the table in question
2. Find all the Stored Procs in the database that relate to that table and add the fields as needed
3. Go to the NopCommerce/Libraries/Nop.DataAccess/Products/Product.cs and add the properties as needed.
4. In the same directory, modify the ProductProvider.cs to include the fields in the methods. Ensure you have modified all methods that list fields (updaters, getters, adders).
5. Go to the NopCommercs/Librarires/Nop.DataAccess.SqlServer/Products and add the fields to the SqlProductProvider.cs file... carefully ensuring you have made changes to all the methods where these changes are needed.
6. Finally, look in both the admin and user side of the web project to ensure your forms carry these fields as needed.
7. Build and fix all the methods you missed.
8. Build and run the application, then fix all the errors you made.

Good luck.
14 years ago
Than u soo much dear friend ... I have been asking about this problem for a long time.

Well I followed all your instructions but facing following problem.

TRY ONE ( On main site )
The site is not going for rebuilding. even if I try going to the page /install/install.aspx  it simply redirects itself to default.aspx and still do not recognize new fields from Product Table saying these fields are not defined in BusinessLogic Product.Products

TRY TWO ( Site Backup Folder )
I even copied everything to a new folder to rebuilt it which did open the install.aspx in the browser BUT its not accepting my Database (one with 3 new fields in Product Table and changes in Stored Procedure)

TRY ONE ( On New Site )
Took a fresh copy of Nop Commerce and made the changes that you instructed except in Database. In Intall.aspx took the option to create new Database because it is not accepting my real database.
ERROR: Categories and Products not showing.
14 years ago
Oops!

My bad, I left off the BusinessLogic stuff!

Should read:

1. Add the fields to the table in question
2. Find all the Stored Procs in the database that relate to that table and add the fields as needed
3. Go to the NopCommerce/Libraries/Nop.DataAccess/Products/Product.cs and add the properties as needed.
4. In the same directory, modify the ProductProvider.cs to include the fields in the methods. Ensure you have modified all methods that list fields (updaters, getters, adders).
5. Go to the NopCommercs/Librarires/Nop.DataAccess.SqlServer/Products and add the fields to the SqlProductProvider.cs file... carefully ensuring you have made changes to all the methods where these changes are needed.
6. Go to the BusinessLogic/Products/Product.cs and ProductManager.cs and modify all needed methods and fields. You may also need to go into some of the other related classes too.
7. Finally, look in both the admin and user side of the web project to ensure your forms carry these fields as needed.
8. Build and fix all the methods you missed.
9. Build and run the application, then fix all the errors you made.

YOu should simply have to rebuild the site in Visual Studio and deploy. You dont need to use the install.aspx stuff.

C.
14 years ago
Dear friend crholliday,

I am really really very thankful to you for helping me out. The problem is solved now :)

Well since I made lots of changes to my site which rebuilding the site didn't allow so I had to use a fresh copy .. now I have to find a way to replace it with my old one.

Once again Thanks buddy for your great support.
14 years ago
I'm glad I could give back a little!

C.
13 years ago
crholliday wrote:
Oops!

My bad, I left off the BusinessLogic stuff!

Should read:

1. Add the fields to the table in question
2. Find all the Stored Procs in the database that relate to that table and add the fields as needed
3. Go to the NopCommerce/Libraries/Nop.DataAccess/Products/Product.cs and add the properties as needed.
4. In the same directory, modify the ProductProvider.cs to include the fields in the methods. Ensure you have modified all methods that list fields (updaters, getters, adders).
5. Go to the NopCommercs/Librarires/Nop.DataAccess.SqlServer/Products and add the fields to the SqlProductProvider.cs file... carefully ensuring you have made changes to all the methods where these changes are needed.
6. Go to the BusinessLogic/Products/Product.cs and ProductManager.cs and modify all needed methods and fields. You may also need to go into some of the other related classes too.
7. Finally, look in both the admin and user side of the web project to ensure your forms carry these fields as needed.
8. Build and fix all the methods you missed.
9. Build and run the application, then fix all the errors you made.

YOu should simply have to rebuild the site in Visual Studio and deploy. You dont need to use the install.aspx stuff.

C.


Thanks a lot for your help,crholliday .
Can you please help me solving this message "there is no source avilable for the current location "that I recive even after following your instructions, in addition to deffrance between the source & original files that prevent me from debugging modified classes.

thanks a lot.
13 years ago
I just replaced old dlls refrences with new one,It works perfectly.
thanks a lot.
13 years ago
Hello.

I'm not sure this applies to the current (1.8) version of nopCommerce. I tried following the steps outlined, but I'm stuck on step 3: there is no "NopCommerce/Libraries/Nop.DataAccess" folder.

Any idea how this is done in the current version?

Regards,
Yiannis
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.