我通过目录菜单添加了新的类别。但是它没有在前端显示类别。
1。
2。是活动的-是
这些是我对新类别所做的设置。保存后,当我去到前端,它不显示类别。如何使在此类别下添加的产品出现在前端
生成的类别id为72显示问题。下面提供的是我在. php文件上使用的代码,用于显示类别id(72)的产品。除了类别id 72(这是新创建的)之外,我可以通过传递类别id检索其他所有类别产品。
<?php
$categoryId = 72;
//here $categoryId is the id of the category
$category = Mage::getModel('catalog/category')->load($categoryId);
$collection = $category->getProductCollection();
$collection->addCategoryFilter($category); //category filter
$collection->addAttributeToFilter('status',1); //only enabled product
$collection->addAttributeToSelect('*');
?>
请帮我解决这个问题
请务必注意以下事项
Is Active = yes
Include in Navigation = yes
It must be sub category of Default Category otherwise you would not able see it
clear magento cache
还请确保链接到此类别的产品必须启用。
如果你还有什么问题,请告诉我
谢谢