0

I have a simple product with a qty of 0. I'm setting the manage_product to 0 like this:

$

product = Mage::getModel("catalog/product")->load($nextId);

        $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());

        $stockItem->setData('use_config_manage_stock', 0);
        $stockItem->setData('manage_stock', 0);
        $stockItem->save();

However, even though the quantity is 0, when I call $product->getStockStatus(); in another script, it's returning the product as in stock!

I tried reindexing, checked that the quantity to put out of stock is 0 in the configuration tab, but nothing seems to work. I even tried changing manage_stock from the CMS, but it still doesn't fix it.

Why is that happening? How can I solve this issue?

2

It's not a bug, it's a feature.

When you set "Manage Stock" to No that means there is no inventory management, thus the product is always in stock and has got an infinte stock.

More information here: http://merch.docs.magento.com/ee_docs/content/catalog/inventory-manage-stock.html

  • I see.. I wish it was a three way option to handle that.. I guess I'll have to manually set the out of stock to 0 when updating the quantities.. – Pat Feb 10 '16 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.