Magento – Add to Cart for Out of Stock Products

addtocart

I'm trying to get the Add to cart button to appear on products that are Out of stock. I've already set the System->Configuration->Catalog->Inventory->Backorders=Allow Qty Below 0

My store previously did not allow back orders. If I add the following code:

<?php echo $this->getChildHtml('addtocart') ?>

The Add to cart appears on products that are In Stock but does not appear on products that are Out of stock.

Troubleshooting:

  • Inventory > Stock Options > Display Out of Stock Products is set to YES
  • Cleared all cache var/cache, var/session, restarted httpd
  • Re-indexed all indexes
  • Tried using default theme with same result

Still no success and as pointed out by Simon this is not a new problem. What I am having trouble understanding is why there would be the option(s) to Allow back orders and Allow stock level quantities to go bellow 0 and not have the Add to cart button.

UPDATE II

I downloaded and installed the latest version of Magento, did a fresh installation, added 2 products, one with inventory (In stock) the other without (Out of stock) have set Allow Qty Bellow 0, Show products out of stock and the same problem.

Would appreciate an explanation and a solution to this problem.

Best Answer

Unfortunately, you are not missing a step here. Normally, people would think that the following two configuration options are enough to make it happen:

  1. Set System - Configuration - Catalog - Inventory - Stock Options - Display Out of Stock Products to Yes.
  2. Set System - Configuration - Catalog - Inventory - Product Stock Options - Backorder to Allow Qty Below 0.

You of course also have to make sure that the same settings are set in the specific product or that the product is configured to use the config settings.

Unfortunately, this is not true. So that it really works, the availability of the product has to be set to In Stock. Otherwise, Magento will not show the add to cart button and will not let you buy the product. This alone would maybe not be a problem if you could configure Magento not to set the product to Out of Stock each time it is ordered and falls below the Qty for Item's Status to Become Out of Stock barrier. But this is not possible. For the smart guys out here: No, it is also not possible to set this setting to a quantity below 0 via the admin settings.

Possibilities:

  1. You could fix the issue that the product is set to Out of Stock by fixing the config entry in the database: UPDATE `core_config_data` SET `value` = '-9999' WHERE `path` = 'cataloginventory/item_options/min_qty';. Although this then applies to all products, not only to the ones which are configured for backorders.
  2. You could try one of the "Preorder" or "Backorder" extensions.
  3. You could set the product to In Stock manually each time such an order occurs (of course only possible for very rare cases).