pablocattaneo
3/18/2016 - 3:44 PM

Obtiene la imagen de una categoría por su ID. Get category image by ID.

Obtiene la imagen de una categoría por su ID. Get category image by ID.

$_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;
}