nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.3k stars 5.32k forks source link

Code for loading/updating products from external source #1966

Closed ArturAlekseev closed 7 years ago

ArturAlekseev commented 7 years ago

As a user I've found another much needed code feature. Store owners in most cases are just distributors and load products information from some external database. And they need to update products information not by hand but from code. The nopCommerce have different types of products (simple, with variants, with attribute combinations or without...). I myself was able to code adding and updating products. But such code is very long. Because we need to add product, add categories, add attributes, add combinations, add mappings, add pictures... So the needed feature is some unified functions like AddProduct(params), UpdateProduct(params), CleanProduct(params) By clean product I mean we need function that will remove all information related to product except its name (to clean database/hd from old products but not to make its page 404). For loading products from external source its also a good idea to add fields to Products, Categories, Manufacturers like: int enternalid, int externaltype; And these fields need index. So that we can use them for identifying from where it was loaded (type for source and id to ident it with same item in external source).

I can try to code such functions myself but I don't think I know database table relations even nearly so well as you.

Also in my opinion the most hard part is attributes/combination management as it is in code.

Plus maybe I'm wrong but I think that some tables should be merged into Products table or at least copied into. Like for example we can add string field for pictures and store there product pictures ids. So when loading product we do not need to make another query on pictures mapping table. I think this should speed up navigation a lot.

AndreiMaz commented 7 years ago

As for external updates please see this task (Web API) - https://github.com/nopSolutions/nopCommerce/issues/20 (availabe at http://www.nopcommerce.com/p/2464/api-plugin.aspx)

As for speed up (table merging). We prefer to use caching where possible rather than de-normalization of tables