Import Categories question

A forum where issues related to the DataPort utility can be discussed.
Post Reply
bcc
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Thu Dec 27, 2007 11:39 pm

Import Categories question

Post by bcc » Sat Jul 04, 2009 3:27 pm

We maintain categories and products information from backend database and need to import these data to shopping cart as routine administration task. The document I read indicates the categoryid is a database sequence number. Can we import the categoryid using the category number we use in our backend database? If the answer is yes, that means the parentid can be the category number we used in backend also, correct? If no, how we can specify the parentid as we will not know the categoryid of the parent category ahead?
thanks!

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Import Categories question

Post by Naveed » Mon Jul 06, 2009 4:54 am

Here is a good reference post for the issue you are facing:
viewtopic.php?f=61&t=10962

Here I am copying some questions/answers from that post:
dooleymort wrote: Since I can't specify the CategoryId, how do I specify what the parentId is when I import?
Off course you can specify the CategoryId, and also the parent Id based upon the category Id's. However it is not guaranteed that the specified categoryId's will be assigned to respective categories, because when importing new categories Id's are automatically assigned. But the key point is that the import routine is intelligent enough to correctly map the child categories to correct parents as specified in the CSV data.

So, you can import something like (omitting extra csv columns fields for simplicity) :

Code: Select all

"CategoryId", "Name", "ParentId"
"100","Parent Category","0"
"101","Child Category A","100"
"102","Child Category B","100"

And even if while importing new categoryId's are assigned to each category, both the "Child Category A" and "Child Category B" will be mapped under correct parent "Parent Category".

bcc
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Thu Dec 27, 2007 11:39 pm

Re: Import Categories question

Post by bcc » Mon Jul 06, 2009 8:25 pm

Thanks!
Will xml import behave the same way?

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Import Categories question

Post by Naveed » Tue Jul 07, 2009 4:01 am

Yes.

Post Reply