Development Best practices for modifying nopcommerce code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hi, I am new to nopCommerce development.
nopCommerce version : 4.40.3

I want to extend functionalities in nop admin,

for eg: I want customer edit form to have upload picture functionality.
I could see that category has this functionality build in.
I could reuse the same and modify the code to get it working.

But this would make it difficut for getting nop updated in future.

I was searching and could not find an easy solution for the latest project.

Could any one share a good way to do this in latest version.
2 years ago
You can introduce a widget plugin to add a view at "AdminWidgetZones.CustomerDetailsBlock" widget zone.
Thus the view will be populated at the bottom of the customer edit details screen, where you can allow admin to add picture/avatar for that customer.

The way NivoSlider plugin follow to add view at "PublicWidgetZones.HomepageTop" widget zone, you can follow same for "AdminWidgetZones.CustomerDetailsBlock" widget zone.
Don't forget to receive customer model as parameter at your view component, here you will get current details page customer id.
As you are new in nopCommerce, this task might be tough for you, so please first understand NivoSlider plugin properly then go for it.
If you need more help please ask. Thanks.
2 years ago
@rmahbub63

Thanks for the reply I could get the admin pannel in customers to override my needs.

I have a confusion now :
how do I save data from there ,
Lets say I added a section which adds some custom data, (I know I could use ajax to save this)

or is it done using the save call from customer, should I override the controller and override methods and make additional changes.

not sure which method to follow.
2 years ago
There was a pull request put in for three demo plugins, but it was rejected. They are here if you'd like to look through them: https://github.com/hnql/nopCommerce/tree/demo-plugin/src/Plugins
2 years ago
if u wish to change the core of Nop, most of the classes are partials.
create a custom folder in each of the projects, put your custom classes in these ne folders.

on a Nop update, download the new update and past your custom folders to the new updated project.
2 years ago
hezyz wrote:
if u wish to change the core of Nop, most of the classes are partials.
create a custom folder in each of the projects, put your custom classes in these ne folders.

on a Nop update, download the new update and past your custom folders to the new updated project.


Thanks for the reply,,

changing classes are straight forward as you mentioned.

Lets say I want to add upload avatar to Customer Edit View in Admin.
I cannot create a new folder and do it same for a view.

How do I manage such cases.

Currently I had to create a plugin, that adds my requirement to the customer view in Admin part.
but for the functionality to work I had to use ajax call and hence, there are some duplication of code.
Also, I could not get it to work on the save customer call, the avatar has a seperate functionality.


I want a simple and mroe elegant way of doing it.
2 years ago
This may interest you
https://www.nopcommerce.com/en/boards/topic/91120/product-review-plugin

(i.e. create a Widget plugin)
2 years ago
New York wrote:
This may interest you
https://www.nopcommerce.com/en/boards/topic/91120/product-review-plugin

(i.e. create a Widget plugin)


Thanks for the reply,

I have succesfully created a plugin, I was asking about optimizing it.
The path I took to get it working in Admin part was not easy.

I could not see any examples for adding functionalities using plugin in admin part.
I have refered to Tax.Avalara plugin, they have some functionalities.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.