Created
March 11, 2011 10:03
-
-
Save ho-nl/865684 to your computer and use it in GitHub Desktop.
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
public function getThumbnailUrl() | |
{ | |
$url = false; | |
if ($image = $this->getThumbnail()) { | |
$url = Mage::getBaseUrl('media').'catalog/category/'.$image; | |
} | |
return $url; | |
} |
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
<li class="level-top"><a class="level-top" href="#"><?php echo $this->__('Your parent'); ?></a> | |
<ul class="level0"> | |
<?php foreach ($this->getStoreCategories() as $_category):?> | |
<?php | |
if ($_category->getId() == '3') { | |
if (Mage::helper('catalog/category_flat')->isEnabled()) { | |
$children = (array)$_category->getChildrenNodes(); | |
$childrenCount = count($children); | |
} else { | |
$children = $_category->getChildren(); | |
$childrenCount = $children->count(); | |
} | |
if ( $childrenCount ) { | |
$this_id = $_category->getId(); | |
foreach ( $children as $child ) { | |
echo $this->drawItem($child); | |
} | |
} | |
} | |
?> | |
<?php endforeach ?> | |
</ul> | |
</li> |
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
echo $this->drawItem($child, 0, true,'thumbnail'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This solution is part of our blog post: Using category images in your Magento navigation. Please subscribe to our RSS or follow us on Twitter for tips & tricks, free Magento extensions and more.