2014-09-02 24 views

回答

1

Magento使用eav模型來保存數據庫中的值。

您必須在「eav_attribute」表中搜索名爲「include_in_menu」的屬性。

該屬性具有「attribute_id」,該屬性將在其他表中檢索。

在我安裝的,此屬性attribute_id = 67被存儲爲一個整數(INT)

在Magento的所有屬性有一個類型,你可以找到eav_attribute表。

您想要更新您的類別,我們必須更新保存類別的整數屬性「include_in_menu」的表格。

正如你可以在你的數據庫中看到,你有類別很多表:

catalog_category_entity,catalog_category_entity_datetime,catalog_category_entity_decimal,catalog_category_entity_int ...

你必須選擇所有的類別從第一table:從catalog_category_entity中選擇entity_id

必須在表中選擇與良好屬性類型相關的attribute_id後。這裏是「catalog_category_entity_int」對於所有的整數屬性......從catalog_category_entity_int 選擇值,其中attribute_id = 67和STORE_ID = ...

要小心,如果你有多個門店...所有的商店都在同一個表。

現在你只需在選定的行上更新值「1」。

對不起,我的英文,讀音字法國...

問候 塞德里克

1

這個答案在Magento的EE 2.2.2工作。

根據Cedric的回答,我使用以下查詢通過Sequel Pro從菜單中刪除所有類別。

運行可以刪除所有從你的菜單中選擇類別的:通過運行

UPDATE catalog_category_entity_int SET value='0' WHERE attribute_id='67' 

可以添加所有類別到您的菜單:

UPDATE catalog_category_entity_int SET value='1' WHERE attribute_id='67' 

然後沖洗你的緩存(php bin/magento cache:flush),你應該在前端看到你的改變。

再次,請注意您正在影響的'store_id'