Massive import of product


https://forum.kartris.com/Topic3895.aspx
Print Topic | Close Window

By Supermac - Thu 6 Aug 2015
I'm on fire :-)
After successful import of customers from csv, I started to think at massive import of products from ERP csv generated file.

As they suggested me for customers, I started to examine ProductsBLL._AddProducts function.

To semplify things, products I'll import will be singleversion type products and will be charged in a bulk category with known ID (in a second step I'll think about tree categories creation for current product I'm inserting).

I got a few problems to identify info I have to supply to _AddProduct function as parameters and to recreate the logic path of product creation:

1- ptbElements (datatable first parameter of function) what should contain exactly? I argue the info listed in LanguageElementFieldNames table (Name, Desc,PageTitle, MetaDescription, ...), have I to supply ALL that info?

2- Once I'll have inserted the product and function will return me ProductID, I'll have a record in Products table, then to add other info (prices, stock quantities, etcetera) I'll have to call VersionBLL._AddNewVersion function, am I correct?
By Supermac - Wed 26 Aug 2015
up
I think I already solved question 1 (mandatory fields are listed in tblKartrisLanguageElementTypeFields table) but still in doubt about point 2 and... are there further info to supply/insertion in other tables to do?
By Supermac - Thu 27 Aug 2015
One step ahead...
ProductsBLL._AddProducts function, when inserting a singleversion item, creates a record in Product table and even a record in Version table thanks to VersionsBLL._AddNewVersionAsSingle function... there are still some shadowed points (i.e. I've to understand why it has inserted a 'live on site' item in products table but version item isn't 'live on site') but all seems to work.
Keep to try.

EDIT
even creating a singleversion product using backend it creates a version with 'live on site' false, so I argue that even my procedure has to work in "update" mode once it has created the version with "default" values, updating price and other data related to the version just created...
How can I get the versionID created by VersionsBLL._AddNewVersionAsSingle function?
If I'm right I need it to use VersionsBLL._UpdateVersion...
By Neil - Thu 27 Aug 2015
Have you not tried using the datatool? We recently used it to import over 11,000 products (with most having over 30 versions each)
By Supermac - Fri 28 Aug 2015
Effectively I didn't consider it.
Seems interesting even the possibility to schedule a nighttime update of products of the store... but I don't know if it match our needs having that "the Data Tool cannot handle cases where multiple products have the same name, or where a products and/or categories have multiple parents"... if I clarify this things here, it could be a solution.

Explain to me two things: looking at the sample xls, P_Image field is the source directory where product images have to be fished by DataTool to be imported in kartris, right?
About categories, when updating products, the key to place products in the right category in xls file is Cat5_Name1/Cat4_Name1/Cat3_... structure. In case of misspelled category name, DataTool will create a new category to place the product or will ignore it considering a multiple-parents product?

About my progress, I was been able to import a singleversion product with its default version and even to update data related to first product imported, but it stops processing the second row of csv file... it tells me "The process cannot access the file 'C:\inetpub\.....ac00-402dfe0a2ce7.csv' because it is being used by another process."
'(
By Supermac - Mon 31 Aug 2015
Solved even last issue with csv file: now I can import tons of singleversion products!