-
- dunix

-
Total Posts: 6
Joined: 2012-09-12
|
<?php //gets all sub categories of parent category 'cat-id-7' $cats = Mage::getModel('catalog/category')->load(7)->getChildren(); $catIds = explode(',',$cats);
$categories = array(); foreach($catIds as $catId) { $category = Mage::getModel('catalog/category')->load($catId); $categories[$category->getName()] = array( 'url' => $category->getUrl(), 'img' => $category->getImageUrl() ); } ksort($categories, SORT_STRING); ?> <ul> <?php if($category->getIsActive()): ?> <?php foreach($categories as $name => $data): ?> <li> <img src="<?php echo $data['img']; ?>" /> <a href="<?php echo $data['url']; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>"><?php echo $name; ?></a> </li> <?php endforeach; ?> <?php endif; ?> </ul>
<img src="<?php echo $data['img']; ?>" />
this is not working
my magento version is 1.7.0.2
|