我刚刚使用以下代码以编程方式创建了一个新的根类别:
$category = new Mage_Catalog_Model_Category();
$category->setStoreId(0);
$category->setName('Storybloks6');
$category->setUrlKey('storyblocks6');
$category->setIsActive('1');
$category->setIncludeInMenu('0');
$category->setDescription('Produtos que aparecem em destaque no carrossel da home');
$category->setDisplayMode('PRODUCTS');
$category->setIsAnchor('0');
$category->setLevel('1');
$category->setParentId('1');
$parentCategory = Mage::getModel('catalog/category')->load('1');
$category->setPath($parentCategory->getPath());
$category->save();
类别已添加,但在管理类别页面中,其标签未出现在菜单上:
新类别在菜单上显示为 (0)。我该如何解决?