2 replies [Last post]
cwittusen's picture
Offline
Joined: 01/30/2008
Juice: 86
Was this information Helpful?

Hi
I'm trying to use node_import along with the patch for ubercart to mass load products; everything seems to map out just fine apart from my terms in a hierarchy layout.

Does anyone know how you map a product into a term in a category in the csv file that you create for node_import?

For instance, we have a baby cloth, they go into baby boy or baby girl and terms under those 2 roots are 0-3 months, 3-6 monts, etc

How would I put that mapping into the csv document?

/Chris

zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 969
Re: Mass loading products with node_import and csv

Assuming your csv file is delimited by a comma, do something like this:

"baby boy|0-3 months", your other comma separated fields go here...

The first field should be mapped to Taxonomy. It will ensure the line is tagged under "baby boy" and "0-3 months" tags.

It should take care of heirachy if you had set-up the hierarchy ahead of the load. If not, it will be tagged by either.... See node_load module's readme.txt, as it may not get it right... It says:

"Add non-existing terms to the vocabulary" : if a term does not
exist, the wizard will inform you during the preview that it will
be created and it will create the term before importing the row.
Note that if you have a single or multiple hierarchy vocabulary
this term may not appear at the right spot in the hierarchy."

You can import hierarchy separately using one of these drupal modules:

http://drupal.org/project/taxonomy_csv

http://drupal.org/project/taxonomy_xml

cwittusen's picture
Offline
Joined: 01/30/2008
Juice: 86
Re: setting terms

Zeezhao:
Thank you; I must have been tired yesterday when I wrote this but I missed one level (see below); additionally, I have pasted one row from my csv to show you what I have currently tested. Problem with the current csv is that it ends up in both baby boy and baby girl and thats what I'm trying to fix so that when I tell it baby girl|sets|0-3 Months it only ends up under Baby girl subterm sets subterm to sets 0-3 Months. Does that make sense? If I try to put it in " " then its puts everything down one line in the load/match screen and it looks odd.

CSV output (1 line)
NAME SKU COST TAX COST INC. TAX SELL PRICE TAX SELL INC TAX DESCRIPTION CATEGORY ROOT ATTRIBUTE IMAGE QTY SHIPPABLE
White pant set GTP080005 6.99 0.45435 7.44435 12.2325 0.7951125 13.0276125 Pant set white and purple. Baby girl|sets|0-3 Months GTP080005.png 1 Y

Structure (partial)
Baby boy
-Tops
--0-3 Months
--3-6 Monhts
-Pants
--0-3 Months
--3-6 Monhts
-sets
--0-3 Months
--3-6 Monhts
Baby girl
-Tops
--0-3 Months
--3-6 Monhts
-Pants
--0-3 Months
--3-6 Monhts
-sets
--0-3 Months
--3-6 Monhts