Fra*_*Kim 2 magento magento-1.13
在主页上,我使用以下代码显示特定类别的一些产品:
{{block type="catalog/product_list" category_id="213" column_count="6" template="catalog/product/list.phtml"}}
是否有一个块可用于通过CMS页面或块呈现类别描述?
没有内置功能,但您可以自己添加一个块.在主页内容中添加:
{{block type="core/template" template="catalog/category/description.phtml" category_id="213"}}
Run Code Online (Sandbox Code Playgroud)
现在 app/design/frontend/{interface}/{theme}/template/catalog/category/description.phtml使用以下内容创建文件
<?php $categoryId = $this->getCategoryId();?>
<?php $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($categoryId);?>
<?php if ($category->getId() && $category->getIsActive() && $_description = $category->getDescription()) : ?>
<?php echo $this->helper('catalog/output')->categoryAttribute($category, $_description, 'description')?>
<?php endif;?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5339 次 |
| 最近记录: |