I do not think the script imports/creates categories, I think it only allows you to assign categories that already exist in your Magento database to the products that you are importing.
Let me do a clean install of magento so I can try to see how this script works. It’s been over a year since I last experimented with Magento so I am not sure how much help I can be to you at the moment.
Let me do a clean install of magento so I can try to see how this script works. It’s been over a year since I last experimented with Magento so I am not sure how much help I can be to you at the moment.
Let me do a clean install of magento so I can try to see how this script works. It’s been over a year since I last experimented with Magento so I am not sure how much help I can be to you at the moment.
Mind if I ask what eCommerce are you using right now if you are not using Magento?
I originally choose Magento because it offers most of the features I need, then I found out its lacking of support and documentation, and even if you pay for the Enterprise Edition, you are basically paying $10k+ a year for a few extra feature, all the problems Community version have is still there.
I was determined I’m going to figure out Magento, so I bought a few books on PHP and cracked through all of them in one week(skipping all my sleep), just to find out there is still a lot more to learn and its just not something I can achieve in a short time…
I’m getting to the point where I’m considering alternatives.
Okay, after 3 days of sleep deprivation and 5 packs of cigarette,
Finally got Hocke’s method working for me.
I was getting an error saying the store does not exist, and the problem was actually very simple. Inside the categories.csv file, the field store name actually refers to the CODENAME of your STOREVIEW.
So in my case my store view is called English, I put that in there exactly, it still didn’t work, almost drove me insane, then I found out the store view’s name is “English” but its code is “english” without the capital letter. So tried that, works perfectly…
Now I’m gonna get busy importing 2000+ categories and then come back to figure out how to import product with category information....
I have sorted it out myself .Below is the code which i hope will help some one
Three things to take care before running this
1.Add the extra field “categoryImage” to set image names.
2.Save images to import in media/import folder
3.Make sure media/catalog/category folder exists
<?php class ImpCat_Catalog_Model_Convert_Adapter_Category extends Mage_Eav_Model_Convert_Adapter_Entity { protected $_categoryCache = array();
/** * Save category (import) * * @param array $importData * @throws Mage_Core_Exception * @return bool */ public function saveRow(array $importData) { if (empty($importData['store'])) { if (!is_null($this->getBatchParams('store'))) { $store = $this->getStoreById($this->getBatchParams('store')); } else { $message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'store'); Mage::throwException($message); } } else { $store = $this->getStoreByCode($importData['store']); }
if ($store === false) { $message = Mage::helper('catalog')->__('Skip import row, store "%s" field not exists', $importData['store']); Mage::throwException($message); }
$rootId = $store->getRootCategoryId(); if (!$rootId) { return array(); } $rootPath = '1/'.$rootId; if (empty($this->_categoryCache[$store->getId()])) { $collection = Mage::getModel('catalog/category')->getCollection() ->setStore($store) ->addAttributeToSelect('name'); $collection->getSelect()->where("path like '".$rootPath."/%'");
For anyone whos planning to use the script from the wiki above ( http://www.magentocommerce.com/wiki/how-to/how_to_import_category_structure_with_products_using_dataflow )
please be aware of a little error for anyone who patches the files by their own:
Line 35: foreach (explode(’ , ‘, $categories) as $categoryPathStr) {
The delimiter “,” has two whitespaces arround so if you want to use multiple categories you need “categorie1 , categorie2 , categorie3”. Anyway i changed the delimiter to : which is in most cases better. “categorie1:categorie2:categorie3”
<br /> <b>Fatal error</b>: Call to undefined method Mycomp_Catalog_Model_Convert_Adapter_Category::getStoreById() in <b>/home6/umelecke/public_html/test/app/code/local/Mycomp/Catalog/Model/Convert/Adapter/Category.php</b> on line <b>43</b><br />
This show me with MyComp solution and ImpCat_Katalogdaten_importieren solution although I do all things in “manual”. Can you help me?
Could someone post the import script using char | and not / to explode the cat|subcats ?
Because with this configuration it interferes with / in my cat names.
Furthermore, how could I get the accentued letter working ?
Luke Terry Creative Design - 15 December 2008 03:43 PM
Hi everyone hoping I can get some help, how can I export categories from one magento store and import them in another? Thanks
EDIT: to be honest I am looking to export all categories, sub categories, products and product images from one magento site to another… is that possible?
Hi
One of the effective ways to do this is use migration service. <a href="http://www.shopping-cart-migration.com/shopping-cart-migration-options/223-magento-to-magento-migration">Cart2Cart</a> online service can help you. It supports export of all the data you mentioned between magento sites. Hope it helps you.
John Here! they guy with the import/export custom options, tier prices, grouped products (associated products)..
I’m currently working on a category import/export module based somewhat on the code from this post and from my own experience with the other module.
I’ve got the export to work just fine.. accept that it doesn’t give me the store ID and I don’t have it exporting the image file path/names yet.
The import works with hierarchy using faux_id’s for initial import of categories, but doesn’t import image files for the category.
I’m looking for 2 people with sites that have many categories to test it.
email me: johncarlson21@gmail.com to give me your info, and I will send you the files and an example import file.
John
Hi John. I wonder if your great work is ready? And if it works with magento 1.4.0.0 ?
I modified PHP code of santhosh kumar so that I could add descriptions, IsActive and IsAnchor to imported file (see attachment) but it does not work on the latest release of Magento 1.4.0.0beta1. The descriptions are not shown up until you click on each category and save it via admin interface, while IsActive and IsAnchor are imported correctly.
The fields of CSV file I used:
store,categories,IsActive,IsAnchor,description