Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Import category structure with products using DataFlow (how to guide)
 
rentown
Jr. Member
 
Total Posts:  29
Joined:  2009-03-01
 

hi,

I’m trying to import the categories and the products on my website.

for now i was only able to import the categories without the products.

here is the how to guide on how to import the categories:

http://www.magentocommerce.com/boards/viewthread/26022/
on page 7 i did a summary: (however it will only import the categories)

Here is how to import both categories and products:

http://www.magentocommerce.com/wiki/how-to/how_to_import_category_structure_with_products_using_dataflow?rev=1228161832

but i’m a newbie and i dont understand nothing about programing.

so i really dont understand how to install this. Can anyone help me?

?can anyone do an step by step guide on how to install”

----------------------------------------------------------------------------------------------------

For now i just unzip the file told. Put on the right folder.

and that’s it.

well at least it seems that its the only thing you need to do.

but it also says that if you can do the unzip part you can do manually.

which i also tried to do.

but i dont understand where to add as it says add this in “your custom overloaded class add these property and method”

where is the “custom overloaded class”?

then it says: “Copy the whole public function saveRow(array $importData) into custom class and make the following “

what saveRow(array $importData)?

and where in custom class?

if this is in “app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php “

i did that and it did not work

and if its in: “app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php “ the “custom overloaded class”

where do i add in “product.php”

Please HELP!

i’m over 3 days trying to figure this out.

any help is apreciated

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
rentown
Jr. Member
 
Total Posts:  29
Joined:  2009-03-01
 

were anyone able to make this work?

http://www.magentocommerce.com/wiki/how-to/how_to_import_category_structure_with_products_using_dataflow?rev=1228161832

 
Magento Community Magento Community
Magento Community
Magento Community
 
haroe
Jr. Member
 
Total Posts:  2
Joined:  2009-08-25
 

hi rentown,
i had the the same problem - and thank god, now it works.... what i did was the following:
1. i copied the “patched” file to the folder: app\code\local\Mage\Catalog\Model\Convert\Adapter
2. i renamed it to Products.php
3. i renamed the class to Mage_Catalog_Model_Convert_Adapter_Products
4. i created an extended import profile with this xml contents:
<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"><![CDATA[CategoriesProducts.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
<var name="store"><![CDATA[0]]></var>
<var name="number_of_records">1</var>
<var name="decimal_separator"><![CDATA[.]]></var>
<var name="adapter">catalog/convert_adapter_products</var>
<var name="method">parse</var>
</action>

5. i created a CategoriesProducts.csv file in var\import with the following contents:
“store”,"categories”,"sku”,"type”,"attribute_set”,"name”,"description”,"short_description”,"weight”,"price”,"tax_class_id"
“default”,"Test/Test”,"foo”,"simple”,"Default”,"t1”,"desc”,"desc”,"0”,"9.99”,"1"
“default”,"Abläufe-Abdeckungen/Belüftungselemente”,"bar”,"simple”,"Default”,"t2”,"desc”,"desc”,"0”,"9.99”,"1"

6. i started the import :o)

i hope it will help you!
cheers harry

 
Magento Community Magento Community
Magento Community
Magento Community
 
NJCMedia
Jr. Member
 
Total Posts:  21
Joined:  2009-02-16
 

How long should the profile take to run?  Mine appears to be hanging even though I only have the 2 sample records you provided.

Also, I had to make the following update:

<var name="adapter">catalog/convert_adapter_product</var> (changed “products” to “product") in my advance import profile.

 
Magento Community Magento Community
Magento Community
Magento Community
 
NJCMedia
Jr. Member
 
Total Posts:  21
Joined:  2009-02-16
 

Wow - I am half way there - I now have products importing!!  Categories not working yet.

I just created a clean version of the test file (when I copied the CVS from the post above some strange characters came with it). 

As for my note on the class name - you just need to make sure it matches in the products.php file and the XML in your advanced import profile.

My products.php

class Mage_Catalog_Model_Convert_Adapter_Product

So XML is

<var name="adapter">catalog/convert_adapter_product</var>

 
Magento Community Magento Community
Magento Community
Magento Community
 
beavis82
Jr. Member
 
Total Posts:  15
Joined:  2009-02-03
 

Has anyone managed to get this to work? Products seem to import ok but categories are ignored?

Si

 
Magento Community Magento Community
Magento Community
Magento Community
 
beavis82
Jr. Member
 
Total Posts:  15
Joined:  2009-02-03
 

After hours of battling - I’ve got this working. I had downloaded the pre-patched files, but eventually noticed the code inside the file didn’t match the code posted on the Wiki page. I don’t know if this is done for a reason, but by mixing copying code across I’ve got it working! I also added the option to make a category an Anchor - this can be commented out if necessary. I’ve attached my file…

Si

File Attachments
Product.php  (File Size: 27KB - Downloads: 574)
 
Magento Community Magento Community
Magento Community
Magento Community
 
ArthurCatigbe
Member
 
Total Posts:  34
Joined:  2009-06-02
 

This method seems to work great. Thank you all for posting.

Does anyone know if it’s possible to set meta_title, meta_description, etc to the categories using this method?

Also, Beavis82. What would the CSV file look like when you include the option to make a category an anchor?

Any help would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ArthurCatigbe
Member
 
Total Posts:  34
Joined:  2009-06-02
 

Any new news?

 
Magento Community Magento Community
Magento Community
Magento Community
 
A.D.
Jr. Member
 
Total Posts:  3
Joined:  2010-01-22
 

i had problems with importing categories (no was imported), but product were imported ok.

Solution which worked for me to change in csv:

“store”,"websites”,"attribute_set”,"type”,"categories”,"sku”,"has_options”,"price"…
“admin”,"base”,"Default”,"simple”,"Cat1/Cat2”,"1037704”,"0”,"888"....

change to:

“store”,"websites”,"attribute_set”,"type”,"categories”,"sku”,"has_options”,"price"…
“default”,"base”,"Default”,"simple”,"Cat1/Cat2”,"1037704”,"0”,"888"....

First i exported some products to see which values i shoul use and store name was admin, so i did same, but nothing worked. So I started thinking that everybody in all examples use default as store name…

After many hours of working on this solution - VOILA

 
Magento Community Magento Community
Magento Community
Magento Community
 
rbach
Jr. Member
 
Total Posts:  2
Joined:  2010-01-05
 
haroe - 18 November 2009 05:38 AM
hi rentown,
i had the the same problem - and thank god, now it works.... what i did was the following:
1. i copied the “patched” file to the folder: app\code\local\Mage\Catalog\Model\Convert\Adapter
2. i renamed it to Products.php
3. i renamed the class to Mage_Catalog_Model_Convert_Adapter_Products
4. i created an extended import profile with this xml contents:
<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"><![CDATA[CategoriesProducts.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
<var name="store"><![CDATA[0]]></var>
<var name="number_of_records">1</var>
<var name="decimal_separator"><![CDATA[.]]></var>
<var name="adapter">catalog/convert_adapter_products</var>
<var name="method">parse</var>
</action>

5. i created a CategoriesProducts.csv file in var\import with the following contents:
“store”,"categories”,"sku”,"type”,"attribute_set”,"name”,"description”,"short_description”,"weight”,"price”,"tax_class_id"
“default”,"Test/Test”,"foo”,"simple”,"Default”,"t1”,"desc”,"desc”,"0”,"9.99”,"1"
“default”,"Abläufe-Abdeckungen/Belüftungselemente”,"bar”,"simple”,"Default”,"t2”,"desc”,"desc”,"0”,"9.99”,"1"

I don’t have any such folder path as \app\code\local\Mage\Catalog\Model\Convert\Adapter

I do have - app/code/core/Mage/Core/Model/Convert/Adapter - is this what is mean - or am I mean to create that folder path inside of local?

Thanks

Matthew

 
Magento Community Magento Community
Magento Community
Magento Community
 
rbach
Jr. Member
 
Total Posts:  2
Joined:  2010-01-05
 
haroe - 18 November 2009 05:38 AM
hi rentown,
i had the the same problem - and thank god, now it works.... what i did was the following:
1. i copied the “patched” file to the folder: app\code\local\Mage\Catalog\Model\Convert\Adapter
2. i renamed it to Products.php
3. i renamed the class to Mage_Catalog_Model_Convert_Adapter_Products
4. i created an extended import profile with this xml contents:
<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"><![CDATA[CategoriesProducts.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
<var name="store"><![CDATA[0]]></var>
<var name="number_of_records">1</var>
<var name="decimal_separator"><![CDATA[.]]></var>
<var name="adapter">catalog/convert_adapter_products</var>
<var name="method">parse</var>
</action>

5. i created a CategoriesProducts.csv file in var\import with the following contents:
“store”,"categories”,"sku”,"type”,"attribute_set”,"name”,"description”,"short_description”,"weight”,"price”,"tax_class_id"
“default”,"Test/Test”,"foo”,"simple”,"Default”,"t1”,"desc”,"desc”,"0”,"9.99”,"1"
“default”,"Abläufe-Abdeckungen/Belüftungselemente”,"bar”,"simple”,"Default”,"t2”,"desc”,"desc”,"0”,"9.99”,"1"

I don’t have any such folder path as \app\code\local\Mage\Catalog\Model\Convert\Adapter

I do have - app/code/core/Mage/Core/Model/Convert/Adapter - is this what is meant - or am I mean to create that folder path inside of local?

Thanks

Matthew

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeauchamp
Jr. Member
 
Total Posts:  11
Joined:  2010-02-04
 

I used this method and I have it working.  This is a just a quick thanks to those that did all the actual work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Benxamin
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-10-06
Sioux Falls, SD
 

Is this now part of Magento? Or do we still need a patch to import products into multiple categories?

 
Magento Community Magento Community
Magento Community
Magento Community
 
chaddro
Jr. Member
 
Total Posts:  25
Joined:  2007-12-20
 

Is this method compatible with 1.4.0.1??

 
Magento Community Magento Community
Magento Community
Magento Community
 
lukewd
Jr. Member
 
Total Posts:  29
Joined:  2009-08-24
 

does this work with 1.4.0.1????

please anyone?

i followed the instructions, but stopped because the directory to extract the patched file does not exist in my installation:
\app\code\local\Mage\Catalog\Model\Convert\Adapter

the directory above named “local” is empty…

please advise.....

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2