try{ $category = Mage::getModel('catalog/category'); foreach ($cat_arr as $cat ) { $category->setName($cat['shortName']); $category->setUrlKey($cat['localizedId']); $category->setIsActive(1); $category->setDisplayMode('PRODUCTS'); $category->setIsAnchor(1); //for active achor $category->setDescription($cat['name']); $category->setStoreId(Mage::app()->getStore()->getId()); $category->setAttributeSetId($category->getDefaultAttributeSetId()); // $parentCategory = Mage::getModel('catalog/category')->load($parentId); // $category->setPath($parentCategory->getPath()); $category->save(); } } catch(Exception $e) { var_dump($e); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)