Magento - 子类别的元描述

时间:2013-01-07 19:32:22

标签: php magento categories

如何获取子类别的metaDesciption(主类别工作正常)?这些不起作用:

$category->load();
if ($title) {
  $headBlock->setTitle($title);
}
if ($description = $category->getMetaDescription()) {
   $headBlock->setDescription($description);
}

我做了很多事但没有成功。

1 个答案:

答案 0 :(得分:0)

这对我有用:

<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
?>   

<p class="subcategory-meta-description">
    <?php echo $cur_category->getMetaDescription(); ?>
</p>