在 Magento 中使用一份库存处理多个项目

发布于 2024-11-06 15:43:03 字数 236 浏览 0 评论 0原文

好吧,我想要的是从同一个库存中提取多种简单的产品。

场景

我有一个指甲锉(库存:500) 我有一盒指甲锉(50/盒

我想要它,这样如果有人买了一盒,那么它会从 500 个单品库存中扣除。本质上,我们所做的是,如果有人购买了一个盒子,那么我们会在一个盒子中向他们运送 50 个单个文件。

有什么简单的方法可以做到这一点吗?

Ok so what I want is to have multiple simple products draw from the same stock.

Scenario

I have a sinle nail file (Stock:500)
I have a box of nail files (50/box)

I want it so that if someone buys a box then it deducts from the 500 stock of the singles. Essentially what we do is if someone buys a box, then we ship them 50 of the single files in a box.

Any easy way to do this?

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

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

发布评论

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

评论(2

戏舞 2024-11-13 15:43:03

这不是 Magento 的本机功能,因此您可以采取几种方法来模拟它:

  1. 使用外部库存管理包来跟踪库存并修改 Magento 以使用它。这将需要更多的后端修改。
  2. 尝试以巧妙的方式使用产品包来愚弄 Magento。这将需要更多的前端修改
  3. 开发或找到 Magento 的物料清单插件。经过短暂搜索后我没有看到任何内容,因此您可能必须构建它。在允许将产品添加到购物车之前,让该模块检查产品的构成材料。

希望有帮助!

谢谢,

This isn't a native function of Magento, so there a few approaches you can take to emulate it:

  1. Use an external stock management package to keep track of stock and modify Magento to use that. This will require more backend modification.
  2. Attempt to fool Magento by using product bundles in clever ways. This will require more frontend modification
  3. Develop or find a Bill of Materials plugin for Magento. I didn't see anything after a short search, so you may have to build it. Have that module check the constituent materials for a product before allowing it to be added to the cart.

Hope that helps!

Thanks,
Joe

未蓝澄海的烟 2024-11-13 15:43:03

考虑:

  1. 为您希望通过这种方式订购的产品创建一个模板。该模板只需是您需要修改的文件,默认情况下它会找到您默认主题中缺少的文件;
  2. 在模板中,您可以放置​​一些 PHP 来编写一些额外的原型 JavaScript;
  3. 该前端代码隐藏了真实的数量框,相关css id的原型'hide'使其成为隐藏的表单字段;
  4. 该代码显示其自己的数量框,还有一个额外字段,用于显示 50 包中需要多少个;
  5. 这些框上的 onchange 事件获取框的值,执行所需的乘法和加法,然后用 (boxes*50)+singles 更新隐藏的“真实”数量框;
  6. 提交后,客户会在购物车中看到订购产品的总量 - 这将是总单位数,而不是“每箱”细分。如果这是一个问题,您可以用一些文字来解释这个问题,或者修改您的主模板来处理这个问题,并向客户展示盒子+单曲的详细信息;
  7. 将您的产品设置为使用包含模板更新代码的“新主题”。
  8. 测试,测试,测试!

正如约瑟夫所提到的,这不能开箱即用。然而,上述解决方法只是部分的,只要您向客户明确表示他们购买的是 500 件而不是 500 盒,那么您应该有一个合理的解决方案。

Consider:

  1. Create a template for the products that you wish to order this way. This template need only be the files you need to modify, by default it will find the missing files from your default theme;
  2. In the template you can place some PHP to write out some extra javascript, of the prototype variety;
  3. This frontend code hides the real quantity box, with prototype 'hide' for the relevant css id to make it a hidden form field;
  4. The code shows its own quantity box, also an extra field for how many of the fifty packs are required;
  5. An onchange event on these boxes gets the values of the boxes, does the required multiplication and addition, then updates the hidden 'real' quantity box with (boxes*50)+singles;
  6. On submit the customer sees in the cart the total quantity of the product ordered - this will be total units, not broken down 'per box'. If this is a problem, you can put some words to explain that or modify your main template to handle this and present to the customer the boxes+singles breakdown;
  7. Set your products to use the 'new theme' that has your template update code.
  8. Test, test, test!

As mentioned by Joseph this cannot be done out of the box. The above workaround is only partial, however, so long as you make it clear to customers that they are buying 500 units instead of 500 boxes then you should have a reasonable solution.

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