Created
October 25, 2011 00:33
-
-
Save anonymous/1310946 to your computer and use it in GitHub Desktop.
Magento EAV Attribute for Category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `eav_attribute` VALUES(132, 3, 'include_in_left_menu', NULL, NULL, 'int', NULL, NULL, 'select', 'Include in Left Navigation Menu', NULL, 'eav/entity_attribute_source_boolean', 0, 0, '1', 0, NULL); | |
<?php $parentCategoryId = 2;?> | |
<?php $_categories = Mage::getModel('catalog/category')->load($parentCategoryId)->getChildrenCategories() ?> | |
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?> | |
<?php if($_count): ?> | |
<div class="block block-layered-nav"> | |
<div class="block-content"> | |
<dl id="narrow-by-list2"> | |
<?php $parentCategoryId = 2;?> | |
<dt><?php echo $this->__('Our Kitchen Range') ?></dt> | |
<dd> | |
<ol> | |
<?php foreach (Mage::getModel('catalog/category')->load($parentCategoryId)->getChildrenCategories() as $_category): ?> | |
<?php if( $_category->getIsActive() && $_category->getIncludeInLeftMenu()): ?> | |
<li> | |
<a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a> | |
</li> | |
<?php endif; ?> | |
<?php endforeach ?> | |
</ol> | |
</dd> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment