1

We are running a shop that has the inventory functions enabled. We have configurable products where the simple products can fall under a stock of 0 and are ordered from our supplier when a order hits us.

The current behavior is, that if a product falls to zero it is automatically set to "out of stock" and therefore not shown anymore in the frontend.

Our wanted behavior is, that the stock availability is NOT set by Magento or it is shown in the frontend that the simple product is out of stock.

We thought this should be possible by setting the Allow qty Below 0 setting to yes but unfortunately Magento still sets the availability from the simple product to "Out of stock".

Are some of our settings wrong or am I missing something else?

7
  • is updating the index fix the issue? like if before index item is zero qty and in stock -- after updating index is the item out of stock or not? Commented Feb 22, 2016 at 12:51
  • Magento doesn't tell us that the index is not up to date. Also, our problem is the other way round. Items with zero qty go out of stock (which shouldn't be the case when setting Allow qty Below 0 to yes)
    – Tim
    Commented Feb 22, 2016 at 12:55
  • You want to display Out of stock products in front end ?
    – Arunendra
    Commented Feb 22, 2016 at 13:09
  • Yes, that was our expected behavior when setting Allow qty Below 0 to yes.
    – Tim
    Commented Feb 22, 2016 at 13:12
  • what happens if you change the field "Qty for Item's Status to Become Out of Stock" on simple product -> Inventory to a negative number?
    – Robin
    Commented Feb 23, 2016 at 10:37

3 Answers 3

2

Warning, using setSkipSaleableCheck(true) appears to have an additional effect of showing disabled products in the dropdown.

The function which is affected by this setting is in Mage_Catalog_Block_Product_View_Type_Configurable:

public function getAllowProducts()
{
if (!$this->hasAllowProducts()) {
$products = array();
$skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck();
$allProducts = $this->getProduct()->getTypeInstance(true)
    ->getUsedProducts(null, $this->getProduct());
foreach ($allProducts as $product) {
    if ($product->isSaleable() || $skipSaleableCheck) {
        $products[] = $product;
    }
}
$this->setAllowProducts($products);
}
return $this->getData('allow_products');
}

if ($product->isSaleable() || $skipSaleableCheck) will therefore always be true

I am yet to dig through the isSaleable() function to determine exactly where this occurs (maybe someone can confirm) but my guess is that it includes a check against the products status which is missed if the skipSaleableCheck is set to true.

0

If you want to display out of stock products on the frontend of your Magento store, go to the Magento admin panel > System > Configuration > Inventory (located in the CATALOG section in the left menu). Then click Stock Options and change the Display Out of Stock Products setting to Yes. Click Save Config to save the change. From now on out of stock products will be displayed on your Magento frontend.
Don't forget to clear your Magento cache.

2
  • Nope, is not working with a configurable product. The "sold out" option is still not visible after it is set to "Out of stock" and clearing all of Magento's cache. Besides: we hat this option already activated.
    – Tim
    Commented Feb 22, 2016 at 13:21
  • do you have multiple store setup ? make sure that you have enable this option for right store .. Commented Feb 29, 2016 at 7:26
0

Your problem can be solved by enabling backorder in magento.

Go to System ->> Configuration
Click on "Inventory" in the left side menu pane
Open the "Product Stock Options" section
Change the "Backorders" to "Allow QTY Below 0 and Notify Customer" or your desired option
Click "Save Config"
1
  • As you can see in my question we already activated Backorders to allow quantities below 0.
    – Tim
    Commented Feb 29, 2016 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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