Best way to create custom inventory import program

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 anos atrás
Hello,

I'm using nopCommerce 3.90 source version.

I'd like to create my own version of the product Excel import program.

I see that the file \Libraries\Nop.Services\ExportImport\ImportManager.cs has the ImportProductsFromXlsx method.

Should I just clone that program and change it to suit my needs or should I create a plugin and use that program in the plugin?

Any ideas that anyone has to accomplish this would be gratefully appreciated.

Thanks,
Tony
6 anos atrás
Carneno wrote:
Hello,

I'm using nopCommerce 3.90 source version.

I'd like to create my own version of the product Excel import program.

I see that the file \Libraries\Nop.Services\ExportImport\ImportManager.cs has the ImportProductsFromXlsx method.

Should I just clone that program and change it to suit my needs or should I create a plugin and use that program in the plugin?

Any ideas that anyone has to accomplish this would be gratefully appreciated.

Thanks,
Tony


You should create a plugin and override / extend existing behavior.

I wouldn't recommend it, but if what you're trying to accomplish is proprietary and you're alright with remembering this change for upgrades, you could modify / override the source method, or create a new partial ImportManager.  

Hope that helps!
6 anos atrás
Adam,

Thanks for your help.  I think I will create a plugin.

AdamK wrote:

I wouldn't recommend it, but if what you're trying to accomplish is proprietary and you're alright with remembering this change for upgrades, you could modify / override the source method, or create a new partial ImportManager.  


I'm not sure of what you mean by this.  I think I know what proprietary means, but can you explain in another way what you are telling me?

Thanks,
Tony
6 anos atrás
By that I mean, if the functionality you're developing is protected or specific to you or your client with no broader appeal.  

Regardless, a new plugin is the way to go and sounds like you're already on-board.

Best of luck!  We're here if you have questions!
6 anos atrás
Adam,

Thanks for your help.

This plugin, that I want to develop, is specific to me and it will only be for my website.

Can you advise me on how to create this plugin?  Should I create a simple plugin with install and configure and have a button in the configure method to call the import method from the configure screen?

Any ideas or help that you can provide would be gratefully appreciated.

Thanks,
Tony
6 anos atrás
Carneno wrote:
Adam,

Thanks for your help.

This plugin, that I want to develop, is specific to me and it will only be for my website.

Can you advise me on how to create this plugin?  Should I create a simple plugin with install and configure and have a button in the configure method to call the import method from the configure screen?

Any ideas or help that you can provide would be gratefully appreciated.

Thanks,
Tony


Here's a link containing good information about nopcommerce plugin development:
http://docs.nopcommerce.com/display/en/How+to+write+a+nopCommerce+plugin

If you'd like to modify the behavior of the existing function globally, you'd create a service that extends "ImportManager" and override the appropriate function.
6 anos atrás
AdamK wrote:
Adam,
Here's a link containing good information about nopcommerce plugin development:
http://docs.nopcommerce.com/display/en/How+to+write+a+nopCommerce+plugin


Adam,

I have worked through most of the plugin development tutorials and have a good idea of how to create a plugin.

AdamK wrote:
Adam,
If you'd like to modify the behavior of the existing function globally, you'd create a service that extends "ImportManager" and override the appropriate function.


I am still learning c#, nopCommerce source, plugins and object oriented programming terminology.  Can you give me more detail about what you are saying?  Specifically "create a service that extends" and "override the appropriate function".

Thanks for your help, but I'm sorry I am not so literate with the terms that you use.

Tony
6 anos atrás
Here's a link to an MSDN article containing good information on extending classes / overriding methods in C# / Java:

https://msdn.microsoft.com/en-us/library/ms228387(v=vs.90).aspx

Hope that helps!
6 anos atrás
Adam,

Thanks for pointing me to that article.

So, if I create a derived class inheriting the class ImportManager, I can override any method or property in that base class.  Specifically the virtual method ImportProductsFromXlsx.

However, I don't see how that helps me.  I want to change some of the assignment statements in the ImportProductsFromXlsx. method.  For instance, price.  If I want to calculate a price in my derived class, how would I do that and still have the base class do all of the other processing?

I hope that makes sense.

Thanks,
Tony
6 anos atrás
Carneno wrote:
Adam,

Thanks for pointing me to that article.

So, if I create a derived class inheriting the class ImportManager, I can override any method or property in that base class.  Specifically the virtual method ImportProductsFromXlsx.

However, I don't see how that helps me.  I want to change some of the assignment statements in the ImportProductsFromXlsx. method.  For instance, price.  If I want to calculate a price in my derived class, how would I do that and still have the base class do all of the other processing?

I hope that makes sense.

Thanks,
Tony


Here's a link with good information.

Hope that helps!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.