Category Archives: Magento

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>

Share

List subcategories with product count Magento

<?php
$_helper = $this->helper(‘catalog/output’);
$_subcategories = $blockId = Mage::getModel(‘catalog/layer’)->getCurrentCategory()->getChildrenCategories();
?>
<div class=”block block-layered-nav”>
<div class=”block-content”>
<dl id=”narrow-by-list”>
<?php if(! empty($_subcategories)): ?>
<dt>Category</dt>
<dd>
<ol>
<?php foreach($_subcategories as $subCategory) : ?>

<?php $prodCollection = Mage::getResourceModel(‘catalog/product_collection’)->addCategoryFilter($subCategory); // Magento product collection ?>
<li><a href=”<?php echo $subCategory->getUrl(); ?>”><?php echo $subCategory->getName(); ?></a>
(<?php echo $prodCollection->count(); ?>)</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
</dd>

</dl>
</div>
</div>

Share