2017-04-20 187 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();