Magento:在类别中为什么 setName 不起作用
我有两个关于 Magento 类别命名的问题。
因为我必须更改一堆类别的名称,所以我写了以下内容:
$category = Mage::getModel ( '目录/类别' ); $tree = $category->getTreeModel(); $tree->load(); $ids = $tree->getCollection()->getAllIds(); 如果($ids){ foreach ( $ids 为 $id ) if ($change[$id] != "") { $_category->setName($change[$id]); $_category->save(); } }
但这不会保存类别的名称?
我可以更改“默认类别”的名称吗?
I have two questions about Magento category naming.
as I have to change the name of bunch of categories, I have written this:
$category = Mage::getModel ( 'catalog/category' ); $tree = $category->getTreeModel (); $tree->load (); $ids = $tree->getCollection ()->getAllIds (); if ($ids) { foreach ( $ids as $id ) if ($change[$id] != "") { $_category->setName($change[$id]); $_category->save(); } }
But this does not save the name of the categories?
Can I change the name of the "Default Category"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TheVyom 在他自己的问题中提供了这个答案:
由于我不在 ADMIN 商店中,因此对类别所做的更改没有得到反映。为了解决这个问题,我需要添加
TheVyom provided this answer in his own question:
As I was not in the ADMIN Store, the changes being made the the categeory was not being reflected. To fix this, I needed to add