-
-
Save amacgregor/1310965 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 | |
$parentid = 3; //Parent category ID | |
$parentCat = Mage::getModel('catalog/category')->load($parentid); | |
$childCategories = explode(',',$parentCat->getChildren()); //Child category IDs separated by commas | |
?> | |
<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($childCategories as $catId): ?> | |
<?php $_category = Mage::getModel('catalog/category')->load($catId); ?> | |
<?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