我想在Magento CMS中创建一个页面,然后在其上回显特定的类别描述。我需要什么代码片段才能完成此任务。我假设我需要在数据库中引用类别的唯一ID来回应他们的描述...
感谢您的帮助!
约翰
答案 0 :(得分:3)
使用PHP:
$categoryId = 15;
$category = Mage::getModel('catalog/category')->load($categoryId);
if($category->getId()) {
echo $category->getDescription(); // Should escape this, blocks have $this->escapeHtml()
}
我不知道如何使用magentos email / cms模板标记(我认为不可能) - 除非你创建一个块或小部件。