Last active
September 16, 2017 00:06
-
-
Save pablocattaneo/67601d38f6f3cd18c145 to your computer and use it in GitHub Desktop.
Obtiene la imagen de una categoría por su ID.
Get category image by ID.
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
| $_helper = $this->helper('catalog/output'); | |
| $_category = Mage::getModel('catalog/category')->load(CATEGORYID);// get your category here. | |
| $_imgHtml = ''; | |
| if ($_imgUrl = $_category->getImageUrl()) { | |
| $_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p>'; | |
| $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image'); | |
| echo $_imgHtml; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment