Magento - 可配置的产品只有在管理面板中手动保存后才可见
我有一个脚本正在创建许多可配置产品及其关联的简单产品。
一切都很顺利,在管理部分检查产品时,一切都已链接并且看起来很棒。
问题是,在我手动转到管理部分并保存可配置产品(不更改任何选项)以及与其关联的每个简单产品之前,产品不可见。保存每个简单产品后,其选项在可配置产品的端变得可用。
有人对此有什么想法吗?
I have a script that is creating a lot of configurable products and their associated simple products.
Everything goes ok and when inspecting the products in the admin section, everything is linked up and looks great.
The problem is that the products are not visible until I manually go to the admin section and save the configurable product - without changing any options - and then each simple product that is associated with it. After each simple product is saved, its option becomes available on the from end for the configurable product.
Does anyone have any ideas on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过执行
Mage_Adminhtml_Catalog_ProductController
中的saveAction
解决了这个问题。我没有正确设置 websiteIds,因此新产品永远不会正确添加到网站。
Magento 使用这段代码来获取正确的网站:
Solved this by going through the
saveAction
in theMage_Adminhtml_Catalog_ProductController
.I wasn't setting the websiteIds correctly so the new products were never getting added to the site correctly.
Magento uses this piece of code to get the correct website:
德鲁上面的回答对我有用。对于那些使用 REST API 的用户,此选项位于 extension_attributes 下,如下所示:
其中 1(对我来说)是我希望产品出现的网站的 ID。
Drew's answer above worked for me. For those using the REST API, this option is under extension_attributes like so:
Where 1 (for me) was the id of the website where I wanted the product to appear.