使用magento is_in_stock
Magento 中的属性 is_in_stock
到底有什么作用?可以通过qty >= 1
来判断产品是否有货。
它似乎会自动调整到当前的库存水平(与最小允许数量相比?),但为什么你可以手动修改它?我觉得修改它没有用,因为无论如何它都会改变成它想要的任何东西。
我无法通过谷歌找到很多关于此属性功能的信息,所以可能是一个很好的补充:-) 。
What exactly is the function of the property is_in_stock
in Magento? Whether a product is in stock can be determined on whether qty >= 1
?
It seems to automatically adjust to the current stock_level (compared to minimal allowed quantity?) but why then can you modify it manually? I feel like it has no use to modify it, because it will change to whatever it wants itself anyway..
I can't find a lot of information about the functionality of this property via google, so might be a good addition :-).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
许多小型商家将使用 Magento 来监控其实际“仓库”(空闲房间)产品库存水平。有时,他们可能希望暂时将网上商店中的商品列为缺货,但由于其他业务原因,他们会希望 Magento 中的库存编号能够反映他们手头的商品数量。
换句话说,
is_in_stock
数据成员控制商店如何显示产品,无论您手头有多少商品。Many smaller merchants will use Magento to monitor their actual "Warehouse" (spare room) stock levels for products. There may be times where they want to temporarily have an item listed as out of stock on their web-store, but they will sto want the stock number in Magento to reflect the number of items they have on hand for other business reasons.
Put another way, the
is_in_stock
data member controls how the store displays the product, irrespective of how many items you have on hand.您可能想深入了解:app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
可能相关的帖子:
在产品上调用 isInStock() 方法时出现 Magento 问题
You may want to dig around: app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
Possibly related post:
Magento issue with calling isInStock() method on a product
完全需要修改我的答案,非常抱歉。当我查看 app/code/core/mage/Catalog/Model/Product.php 中定义的函数时,我看到了这种非常奇怪的情况:
因此,只要产品已启用,isInStock 将始终返回 true。判断产品是否待售的函数是 isSaleable()。
Totally need to revamp my answer here so many apologies. When I looked at the function as it is defined in app/code/core/mage/Catalog/Model/Product.php I saw this very odd situation:
So as long as a product is Enabled, isInStock will always return true. The function for telling if a product is for sale is isSaleable().