Jump to content

Magento getUrl() not working?


kaylamatthews

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.