Magento News

 

How to make Categories with sub categories not linkable

Should be a simple question. But i’ve got a category list in Magento that has sub categories. And i want to make my categories with subs under then act as a title, instead of a clickable link to that category. So for instance:

Link 1
Link 2
Link 3 (this should be a title)
---Link 1
---Link 2
Link4

I’m getting my categories likes so.

<?php foreach ($helper->getStoreCategories() as $_category): ?>

<li> <a href="<?php echo Mage::getModel('catalog/category')->setData($_category->getData())->getUrl(); ?>" title="<?php echo $_category->getName() ?>"><?php echo $_category->getName() ?></a>

<?php foreach (Mage::getModel('catalog/category')->load($_category->getId())->getChildrenCategories() as $childCategory):?>
  <?php echo '<li class="subCats"><a href="'.$childCategory->getUrl().'">'.$childCategory->getName() .'</a></li>'; ?>
  <?php endforeach;?>

</li>

<?php endforeach ?>

Any help would be greatly appreciated.
thanks

How to make Categories with sub categories not linkable

Possibly Related Posts:


 

Leave a Reply