Tag Archives: Magento

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; ?>

Magento set the layout 2 column left Shared Wishlist View

Edit wishlist.xml and replace the code

<wishlist_shared_index translate=”label”>
<label>Customer Shared Wishlist View</label>
<!– Mage_Wishlist –>
<reference name=”content”>
<block type=”wishlist/share_wishlist” name=”customer.wishlist” template=”wishlist/shared.phtml” />
</reference>

</wishlist_shared_index>

with

<wishlist_shared_index translate=”label”>
<label>Customer Shared Wishlist View</label>
<!– Mage_Wishlist –>
<reference name=”content”>
<block type=”wishlist/share_wishlist” name=”customer.wishlist” template=”wishlist/shared.phtml” />
</reference>

<reference name=”root”>
<action method=”setTemplate”><template>page/2columns-left.phtml</template></action>
</reference>

</wishlist_shared_index>