<?php $Category = Mage::getModel(‘catalog/category’)->load($categoryId); ?>
<?php echo $Category ->getImageUrl() ?>
Category Archives: Magento
Check if flat product is enabled Magento
<?php if (Mage::helper(‘catalog/product_flat)->isEnabled()) { ?>
<?php } ?>
Check if flat catalog is enabled Magento
<?php if (Mage::helper(‘catalog/category_flat’)->isEnabled()) { ?>
<?php } ?>
List sub-categories on a category page flat catalog enabled Magento
<?php
$_cat = new Mage_Catalog_Block_Navigation();
$currentCat = $_cat->getCurrentCategory();
$subCats = Mage::getModel(‘catalog/category’)->load($currentCat->getId())->getChildren();
$subCatIds = explode(‘,’,$subCats);
?>
<?php if (count($subCatIds) > 1): ?>
<ul>
<?php foreach($subCatIds as $subCatId): ?>
<?php $subCat = Mage::getModel(‘catalog/category’)->load($subCatId); ?>
<li>
<a href=”<?php echo $subCat->getUrl(); ?>”>
<?php echo $subCat->getName(); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
List sub-categories on a category page Magento
<?php
$_cat = new Mage_Catalog_Block_Navigation();
$currentCat = $_cat->getCurrentCategory();
$subCats = Mage::getModel(‘catalog/category’)->load($currentCat->getId())->getChildren();
$subCatIds = explode(‘,’,$subCats);
?>
<?php if (count($subCatIds) > 1): ?>
<ul>
<?php foreach($subCatIds as $subCatId): ?>
<?php $subCat = Mage::getModel(‘catalog/category’)->load($subCatId); ?>
<li>
<a href=”<?php echo $subCat->getUrl(); ?>”>
<?php echo $subCat->getName(); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>