2017-04-20 6 views

답변

1

는 카테고리 ID로 카테고리 이름에 대한 다음 코드를 사용하십시오. 또한 미리보기 이미지 등을 얻으십시오.

$categoryId = 5; // Change category id according to you or use dynamic category variable 

// display name and other detail of all category         

$_category = Mage::getModel('catalog/category')->load($categoryId); 

echo $categoryName = $_category->getName(); 

echo $categoryDescription = $_category->getDescription(); 

echo $categoryUrl = $_category->getUrl(); 

echo $categoryThumbnail = $_category->getThumbnail(); 

echo $categoryLevel = $_category->getLevel(); 

echo $parentCategoryId = $_category->getParentId(); 
+0

감사합니다. @ pankaj 선생님. –

0

,이 같은 정보를 얻을 수 있습니다 :

$category = Mage::registry('current_category'); 
echo $category->getName(); 
0

범주 모델에서 작동합니다.

$Category=Mage::getModel('catalog/category')->load($cat); 
    $cat_name=$Category->getName();