Magento-查找有库存的缺货产品 [英] Magento - Find Out of Stock Products With Inventory

查看:48
本文介绍了Magento-查找有库存的缺货产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Magento商店中,有时我会在将新库存添加到缺货商品后,从下拉列表中选择库存".

In my Magento store I sometimes forget to select 'In Stock' from the dropdown after adding new inventory to an out of stock item.

是否有可能以某种方式获得所有具有库存但标记为缺货"的产品的清单?

Is it possible to somehow get a list of all products which have inventory but as tagged as "Out of Stock"?

推荐答案

如果您能够快速编写出真正的脚本.

If you are able to script something real quick.

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter('is_in_stock', 0)
->addAttributeToFilter('qty', array("gt" => 0));

遗憾的是,我似乎不记得如何以一种可行的方式放入> 0.也许有人可以对此发表评论.

Sadly I can't seem to remember how to put in the >0 in a way that is supposed to work. Maybe someone can comment on that.

使用$ products可以执行的操作是通过一个foreach循环运行它,然后将is_in_stock的值设置为1,这样您就可以开展业务了.

What you can do with $products is run it through a foreach loop and then set the is_in_stock to the value of 1 and you should be in business.

这篇关于Magento-查找有库存的缺货产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆