如何获取子类别的metaDesciption(主类别工作正常)?这些不起作用:
$category->load();
if ($title) {
$headBlock->setTitle($title);
}
if ($description = $category->getMetaDescription()) {
$headBlock->setDescription($description);
}
我做了很多事但没有成功。
答案 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>