【问题标题】:Why magento 1.7.0.2 not showing newly added categories?为什么 magento 1.7.0.2 不显示新添加的类别?
【发布时间】:2015-09-22 06:57:57
【问题描述】:

我通过目录菜单添加了新类别。但它没有在前端显示类别。

1.类别在默认类别下。

2.是否活跃 - 是

这些是我对新类别所做的设置。保存后,当我转到前端时,它不显示类别。如何让添加到该分类下的产品出现在前端。

生成的类别 id 为 72 表明存在问题。下面提供的是我在 .phtml 文件中使用的代码,用于显示类别 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('*');
?>

请帮我解决这个问题

【问题讨论】:

    标签: php magento


    【解决方案1】:

    请确认以下事项

    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
    

    另外请确保必须启用链接到该类别的产品。

    如果您仍然遇到任何问题,请告诉我

    谢谢

    【讨论】:

    • 是的,上述几点已经完成。但仍然无法得到结果。
    • 另外,通过传递 id 72,该站点也无法工作。休息所有其他 id 工作正常。
    • 您在创建类别后重新索引了吗?
    • 天哪!忘了重新索引。谢谢!它现在工作正常。
    • 如果您得到答案,请将此问题标记为已完成,谢谢
    猜你喜欢
    • 2012-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-29
    • 2012-05-08
    • 1970-01-01
    • 1970-01-01
    • 2013-09-21
    相关资源
    最近更新 更多