【问题标题】:$this->getStoreCategories() is Not returning anything after deleted data from the categories releated tables in magento$this->getStoreCategories() 在从 magento 中的类别相关表中删除数据后不返回任何内容
【发布时间】:2013-02-13 17:58:41
【问题描述】:

我需要导航菜单方面的帮助。当我在管理面板中添加新类别时,导航菜单未显示任何类别。导航菜单中根本没有显示任何类别。

这是我对导致问题的数据库所做的操作。 截断表catalog_category_entity; 截断表catalog_category_entity_datetime; 截断表catalog_category_entity_decimal; 截断表catalog_category_entity_int; 截断表catalog_category_entity_text; 截断表catalog_category_entity_varchar; 截断表catalog_category_product; 截断表catalog_category_product_index;

插入catalog_category_entity(entity_id,entity_type_id,attribute_set_id,parent_id,created_at,updated_at,path,position,level@) (1,3,0,0,'0000-00-00 00:00:00','2009-02-20 00:25:34','1',1,0,1),(2,3 ,3,0,'2009-02-20 00:25:34','2009-02-20 00:25:34','1/2',1,1,0); 插入catalog_category_entity_int(value_id,entity_type_id,attribute_id,store_id,entity_id,value) 值 (1,3,32,0,2,1),(2,3, 32,1,2,1); 插入catalog_category_entity_varchar(value_id,entity_type_id,attribute_id,store_id,entity_id,value) 值 (1,3,31,0,1,'根目录'),(2 ,3,33,0,1,'root-catalog'),(3,3,31,0,2,'Default Category'),(4,3,39,0,2,'PRODUCTS'),( 5,3,33,0,2,'default-category');

运行上述查询后,导航菜单中的所有类别都消失了,即使我在管理面板中添加更多类别,也没有显示类别。

我检查了 top.phtml 文件,代码 $this->getStoreCategories() 没有返回任何内容。

我该如何解决这个问题?

谢谢

【问题讨论】:

  • 您尝试更新索引了吗?
  • 您到底为什么要在数据库级别执行此操作?模型的存在是有原因的。
  • 您是否已将默认类别添加到您的商店?并且您是否检查过您的所有类别都将“在菜单中显示”选项设置为“是”?请在管理员中检查并重新索引一次。

标签: magento navigation categories


【解决方案1】:

通过运行 Magento 示例数据 sql 文件将数据插入回来解决了该问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 1970-01-01
    • 1970-01-01
    • 2021-06-15
    • 2021-01-18
    • 1970-01-01
    相关资源
    最近更新 更多