Magento 库存管理
我创建了新的产品类型,其目的是通过电子邮件销售数码照片、序列号或其他多媒体文件等商品。这个想法类似于内置可下载产品类型,但在我的实现中,每个文件必须不同。问题是计算库存水平,这表明还有多少文件可供销售。如何根据外表中关联行的计数而不是产品编辑器中的用户输入来计算产品库存数据?
I have created new product type whose aim is to sell goods such as digital photos, serial codes or other multimedia files via email. The idea is similar to build-in downloadable product type but in my implementation each file must be different. The problem is to calculate stock levels, which indicate how many files remain available for sale. How can I calculate product stock data based on count of associated rows in foreign table instead of user input in product editor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最好的解决方案是更新每次销售的库存数据或将行添加到外部表中。如果您将加入外部表并动态计算它,那么您只会遇到性能问题。只需概述以下类:
Mage_CatalogInventory_Model_Indexer_Stock
和Mage_CatalogInventory_Model_Stock
,以阐明 Magento 中的库存功能。I think the best solution will be to update stock data on each sale or adding of the rows into foreign table. If you will join your foreign table and will calculate it on the fly, you just will have performance problems. Just overview the following classes:
Mage_CatalogInventory_Model_Indexer_Stock
andMage_CatalogInventory_Model_Stock
for clarifying of stock functionality in Magento.