如何使用 magento API 将更简单的产品添加到可配置产品中
如何简单地将新的简单产品逐步添加到可配置产品中?
或者我是否仍然需要先检索预定义可配置产品的 2 个原始数组(getConfigurableAttributesData 和 getConfigurableProductsData),附加新数组并再次设置它们?它对我的案例是否和第一次创建一样有效?
如果新的简单产品拥有新的属性/属性选项,我是否还需要在添加之前先创建/编辑属性?
提前致谢!
How can I simply add new simple products incrementally to configurable products?
or do I still need to retrieve the 2 original arrays of the pre-defined configurable product (getConfigurableAttributesData and getConfigurableProductsData) first, append the new arrays and set them again? Is it worked for my case just as the first-time creation?
And if the new simple product owns a new attribute / attribute options, do I also need to create /edit the attribute first before adding?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前的 API 不具备执行此操作的功能。
您的选择是:
您所采取的方法还取决于您的 SKU 命名方案,如果您有一个简单的 BASECODE-SIZE-COLOUR 类型的方案,那么 SQL 选项可以发挥作用,并且几乎不需要任何时间,但会受到 Magento 布道者的严重蔑视。
这意味着您可能必须编写自己的代码。这是一个非常有用的网站,可以帮助您入门:
http://www.ayasoftware.com/
作为除了能够导入可配置项(通过包括 SQL 在内的各种方式)之外,还有一些可用于更新超级属性价格差异的代码片段。没有现成的完整解决方案,但是,您可能需要根据您的 SKU 命名方案自行推出。
当您这样做时,您可能还想编写一些代码来查找一些简单的产品,这些产品在应该连接的时候没有连接到任何东西,即。那些看不到的。
The API as it stands does not have the functionality to do this.
Your options are:
The approach you take also depends on your SKU naming scheme, if you have a simple BASECODE-SIZE-COLOUR type of scheme then the SQL option can work a treat, and in next to no time, but will be heavily scorned on by Magento evangelists.
That means you are probably going to have to write your own code. Here is a very useful site that should help get you started:
http://www.ayasoftware.com/
As well as being able to import configurables (by a variety of means including SQL) there are also snippets of code useful for updating superattribute price differentials. No readymade complete solution, but, you may need to roll your own anyway depending on your SKU naming scheme.
Whilst you are at it you may also want to write some code to find simple products that are not hooked up to anything when they should be, i,e. the ones with no visibility.