kaylamatthews Posted May 4, 2011 Share Posted May 4, 2011 I got to this and it’s bringing up the getName but the getUrl() isn’t returning any URL at all.... <?php $children = Mage::getModel('catalog/category')->getCategories(3); foreach ($children as $category): echo '<li><a href="' . $category->getUrl() . '">' . $category->getName() . '</a></li>'; endforeach; ?> The output code is just <li><a href="">name of sub-cat</a></li> Anybody have any ideas Please? I have been trying to figure this out for over 5 hours to no avail Thanks in advance! Kayla Link to comment https://forums.phpfreaks.com/topic/235557-magento-geturl-not-working/ Share on other sites More sharing options...
Web Developer Posted May 11, 2011 Share Posted May 11, 2011 echo '<li><a href="' . $category->getUrl() . '">' . $category->getName() . '</a></li>'; in this line use "children" instead of "category"(at both the positions) Link to comment https://forums.phpfreaks.com/topic/235557-magento-geturl-not-working/#findComment-1213774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.