0

What is the difference between out of stock and 0 of stock?

I have an extension that automatically displays products from the same category as related products, however it displays products that are out of stock as well.

I checked in system configurations/inventory/stock options Display Out of Stock Products NO

In it's code it does not check for quantity left, it checks for stock value. So do I need to set up a stock value for every product? If so how do I do it?

I found this in the code of the extension

            $products->getSelect()->order(new Zend_Db_Expr('RAND()'));
            Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($products);

            $this->setData('related_products', $products);
  • 1
    That depends on the extension that you use. Without the code we can't help you more. – Zvonimir Burić Apr 10 '14 at 14:22
  • yes I agree with @ZvonimirBurić Please update the code then and then we can help you – Keyul Shah Apr 10 '14 at 17:27
0

Both of these attributes are related to products which have managed stock, this information is stored in the cataloginventory_stock_item table.

Specifically what you are refering to is:

is_in_stock: This determines whether a product is saleable, it can have a value of 0 (not available), or 1 (available). Essentially, this tells the customer whether or not a product is available, or Out of Stock.

qty: This is a positive or negative decimal value which indicates available stock quantity.

For these to come into effect, the product in specific must have stock managed set to yes.

The difference between the two:

Some products are back-orderable (i.e do not become out of stock when reaching negative qty values (handled by the use_config_backorders & backorders fields))

Also, some products have specific qty levels at which they become out of stock (handled by the use_config_min_qty & min_qty fields)

Magento offers further information on this topic over here:

MagentoCommerce | Managing Stock for Configurable Products

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.