Php magento中没有显示类别的页面
我想根据我在自定义导航菜单中选择的类别调用magento中的页面。但每当我加载我的工具栏时,它都不会显示指向我的类别的任何href链接。这是我为菜单所做的:Php magento中没有显示类别的页面,php,magento,categories,magento-1.8,Php,Magento,Categories,Magento 1.8,我想根据我在自定义导航菜单中选择的类别调用magento中的页面。但每当我加载我的工具栏时,它都不会显示指向我的类别的任何href链接。这是我为菜单所做的: <?php $_helper1 = Mage::helper('catalog/category') ?> <?php $_categories = Mage::getModel('catalog/category')->getCollection() ->ad
<?php $_helper1 = Mage::helper('catalog/category') ?>
<?php $_categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('name')
->addAttributeToSelect('is_active'); ?>
<div class="sidebar" style="display:block;">
<h3>Product Categories</h3>
<ul>
<?php foreach($_categories as $_category): ?>
<li>
<a href="<?php echo $_category->getCategoryUrl($_category); ?>">
<span><?php echo $_category->getName(); ?></span>
</a>
</li>
<?php endforeach; ?>
产品类别
-
输出总是显示:
<a href="">
<span>Category 1</span>
</a>
我也不知道如何设置哪些产品应该只显示在每个类别中。有可能吗?假设您想在类别中显示一些文本块。这是Magento的默认功能
静态块和产品
要将产品分配到类别,您必须编辑“产品和外观类别”选项卡,从中可以将产品关联到类别。是否需要在静态块中添加一些内容以显示网格?我通常会把这个代码放在{{block type=“catalog/product\u list”name=“home.catalog.product.list”alias=“products\u homepage”template=“catalog/product/list.phtml”}上,还是留空?