Magento - Inventory of Inventory Products

In my Magento store, I sometimes forget to select “In Stock” from the drop-down list after adding new inventory to the stock item.

Is there any way to get a list of all products that have inventory, but how are marked as “Out of stock”?

+5
source share
5 answers

If you can script do something real.

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

Unfortunately, I cannot remember how to put in> 0 in a way that should work. Maybe someone can comment on this.

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

+8
source

( )

→ → / →

, . . "is_in_stock" - 1 = , 0 = . 0, OOS.

RSS http://shop.com/index.php/rss/catalog/notifystock/

+1

Mage:: getModel ( 'cataloginventory/stock_item') → loadByProduct ($ _ ) → getQty()

/// /[YourTemplate]/template/catalog/product/list.phtml

.

+1
source

Loading goods by order and descending

$products
->joinField(
            'inventory_in_stock', 
            'cataloginventory_stock_item', 
            'is_in_stock', 
            'product_id=entity_id',
            'is_in_stock>=0', 
            'left'
)
->setOrder('inventory_in_stock', 'desc');
0
source

The shortest way:

Mage :: getSingleton ('cataloginventory / stock') → addInStockFilterToCollection ($ _ collection);

0
source

All Articles