Magento 类别丢失“include_in_menu”价值——如何?

发布于 2024-09-30 11:57:34 字数 382 浏览 4 评论 0原文

Magento CE 1.4(也称为 EE 1.8)为类别实体引入了一个新属性; include_in_menu。我非常仔细地检查过,没有任何代码将其设置为除“1”之外的任何值。默认值为“1”。没有一个选项可以控制它。然而,当我的某些类别从导航中消失时,我发现该属性已被清除。

我可以看到 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php 添加了属性的过滤器,这就是读取值的方式。果然,如果我强行清除数据库中的值,这些记录就会被正确过滤掉并从前端导航中消失。

我已经重置了所有值,现在工作正常。但是我不明白为什么会出错,也不明白如何防止它再次发生。有人可以建议可能的原因吗?

Magento CE 1.4 (also EE 1.8) introduced a new attribute to category entities; include_in_menu. I've checked very carefully and no code ever sets it to anything but "1". The default value is "1". There isn't an option to control it. And yet when some of my categories disappeared from the navigation I found this attribute had been cleared.

I can see app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php adds a filter for the attribute, this is how the value is being read. Sure enough, if I forcibly clear the value in the database those records are correctly filtered out and disappear from the front end navigation.

I've since reset all the values and it works fine now. However I don't understand why it went wrong nor how to prevent it happening again. Can anyone please suggest possible causes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦初启 2024-10-07 11:57:34

管理员中“一般信息”选项卡上“管理类别”下有一个名为“包含在导航菜单中”的用户控件。这个值有可能是手动切换的吗?

There's a user control in the admin under Manage Categories on the General Information tab called "Include in Navigation Menu". Is it possible that this value was toggled manually?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文