我已经能够实例化一个类别对象以检索其名称,但是当我使用getUrl方法时,它不会将URL返回到类别列表页面,或者任何东西
<?PHP $children = Mage::getModel('catalog/category')->getCategories(3); foreach ($children as $category): echo '<li><a href="' . $category->getUrl() . '">' . $category->getName() . '</a></li>'; endforeach; ?>
<li><a href="">name of sub-cat</a></li>`
更换
原文链接:https://www.f2er.com/php/132138.html$children = Mage::getModel('catalog/category')->getCategories(3);
同
$children = Mage::getModel('catalog/category')->load(3)->getChildrenCategories();