how to display thumbnail from category using getThumbnailUrl() in Magento

后端 未结 3 965
轮回少年
轮回少年 2021-01-24 07:03

I have bee trying to make this work but had no luck, Basically I need to display the main menu categories on the content block and I did, but now I need to display the thumbnail

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 07:40

    There is no need to change app/code/local/Mage/Catalog/Model/Category.php

    It can be done easily through these line of code...try this...Its Works

    $child= Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId();
    
    $imageSrc = Mage::getModel('catalog/category')->load($child)->getThumbnail();
    
    $ThumbnailUrl = Mage::getBaseUrl('media').'catalog/category/'.$imageSrc;
    
    echo "";
    

提交回复
热议问题