从 Magento 数据库获取所有可能的可配置产品 SKU 和选项 SKU
我不是编码员(只是一个脚本小提琴手),我在 Magento 上遇到了一个特殊问题,我无法用代码或数据来解释,所以我需要解释一下情况。 我销售有多种选项的可配置产品。这些家具产品使用各种代码来描述产品的最终 SKU。我从未完整地编写或列出过我使用过的任何电子商务产品之外的所有可能的 SKU,但总是使用应用内选项(在 Magento 的情况下为自定义选项)在客户订购产品时创建 SKU。
现在我面临着一场噩梦,因为我终于为我们公司制定了 QuickBooks 解决方案,但我需要获得一个包含所有可能的 SKU# 的文件以导入到 QB,以便我们可以使用下载例程 (ecc)从 Magento 获取所有订单并将其放入 QB,而无需即时创建每个新产品。我的每一个产品都有以下选择:
- BaseSKU#
- FinishColorSKU#
- FabricComboSKU#
- FabricColorSKU#
所以,比如说,我卖一把椅子。椅子的基本 SKU# 是 708。椅子有 7 种饰面,每种饰面都有自己的代码,所以现在我有 7 个 SKU。每把椅子+饰面都有 5 种面料组合款式。不是真正的布料,只是它应用在椅子上的方式。所以7*5=35是没有问题的。现在开始变得棘手了。其中 2 种面料组合款式仅使用 1 种面料。我们有 60 种面料。 35*60=2100。此时,这在excel中创建,一堆复制粘贴也不是不可能,而是可以做到的。现在其他三种面料组合款式使用 2 种面料。我需要为每种可能的面料组合创建一个 SKU。因此,仅面料就有 60*60=3600 种可能的组合。现在,将其与 35 种不同的椅子+饰面组合相结合,一种产品就有 126,000 个可能的 SKU。乘以 300 个乘积,我无法在 Excel 中手动完成此操作。最终的 SKU 如下所示:
一种颜色的椅子: 708-117-SC-5708
椅子708+框架117+单色+彩色5708
两色椅子: 708-117-DC-5708-5709
Chair708+Frame117+DualColor+Color5708+Color5709
现在,由于这些可能的组合存在于 Magento 数据库中,只是没有组合,有没有办法以编程方式创建所有可能的组合并将它们集中到 Excel 中文件,或 csv,或任何东西?这在 Excel 中可行吗?也许我只需要下载数据库,将正确的表导出到 Excel 并在那里执行。
任何帮助将不胜感激。
编辑:正在考虑这个,也许问这个问题最简单的方法是:
如何使 Magento 输出所有可能的产品和选项的列表?
I'm not a coder (just a script fiddler) and I've got a particular problem with Magento that I cannot explain in terms of code or data, so I need to explain the situation.
I sell configurable products that come in an array of options. These are furniture products that use various codes that describe the final SKU of the product. I've never fully written or listed every possible SKU outside of any e-commerce product I've used, but always used the in-app options, in Magento's case, custom options, to create an SKU as the customer orders the product.
Now I'm facing a nightmare as I'm finally getting a QuickBooks solution mapped out for our company, but I need to get a file with every possible SKU# to import into QB, so that we can use a download routine (ecc) to grab all the orders from Magento and pop them into QB without having to create each new product on the fly. Each one of my products has the following choices:
- BaseSKU#
- FinishColorSKU#
- FabricComboSKU#
- FabricColorSKU#
So, for instance, I sell a chair. The chair's base SKU# is 708. The chair comes in 7 finishes, each with it's own code, so now I have 7 SKU's. Each chair+finish comes in 5 fabric combination styles. Not actual fabric, just the way it's applied to the chair. So 7*5=35 is no problem. Now it starts to get tricky. 2 of those fabric combo styles use only 1 fabric. We have 60 fabrics. 35*60=2100. At this point, this is not impossible to create in excel, a bunch of copying and pasting, but it can be done. Now the other three fabric combo styles use 2 fabrics. I need to create a SKU for every possible combination of fabric. So 60*60=3600 possible combinations of the fabrics alone. Now combine that with 35 different chair+finish combo, that's 126,000 possible SKU's for one product. Multiply that times 300 products, there is no way I could do this by hand in Excel. The final SKU looks like these:
One color chair:
708-117-SC-5708
Chair708+Frame117+SingleColor+Color5708
Two color chair:
708-117-DC-5708-5709
Chair708+Frame117+DualColor+Color5708+Color5709
Now, since these possible combinations exist in the Magento Database, just not combined, is there any way to programmatically create all possible combinations and lump them into an Excel file, or csv, or ANYTHING? Is this possible in Excel? Maybe I just need to download the database, export the right table to Excel and do it there.
Any help would be really appreciated.
EDIT: Was thinking about this, and maybe the simplest way to ask this question would be:
How to make Magento output a list of all possible products and options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用导出功能:系统 ->导出/导入 ->数据流 - 配置文件 ->导出所有产品。使用起来非常简单,但如果您需要更多帮助,请随时询问。
You can use the export functionnality: System -> export/import -> dataflow - profiles -> Export All Products. It's pretty straight-forward to use, but feel free to ask if you need more help.