简体   繁体   English

为什么magento 1.7.0.2不显示新添加的类别?

[英]Why magento 1.7.0.2 not showing newly added categories?

I added the new category through catalog menu. 我通过目录菜单添加了新类别。 But its not showing the category in front end. 但是它没有在前端显示类别。

1.Category is under default category. 1.Category在默认类别下。

2.Is Active -Yes 2.是否正在使用-是

These are the setting I have done with new category. 这些是我对新类别所做的设置。 After saving this, When I go to the front end its not displaying the category. 保存此内容后,当我转到前端时不显示类别。 How do I make products added under this category appear in front end. 如何使添加到此类别的产品出现在前端。

The category id generated is 72 is showing the issue. 生成的类别ID为72正在显示该问题。 Below provided is the code which I am using on the .phtml file to display the products of the category id(72). 下面提供的代码是我在.phtml文件上使用的代码,用于显示类别为id(72)的产品。 Except category id 72(which is created newly), rest all other category products I am able to retrieve by passing the category id. 除了类别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('*');
?>

Please help me to solve this issue 请帮我解决这个问题

Please make sure with the following things 请确保以下事项

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

Also please make sure that product those which linked to this category must be enabled. 另外,请确保必须启用链接到该类别的产品。

let me know if you still facing any problem 让我知道您是否仍然遇到任何问题

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM