This question was already asked, but I want to know is there some issue if I use following solution to limit the backorder qty:
I'll set "Qty for Item's Status to Become Out of Stock
" as negative number on Inventory tab of product edit page and re-assign this negative number via catalog_product_prepare_save
observer. Thanks.
Magento – Limit backorder qty of the product
backorderee-1.13.1.0stock
Best Answer
Crazy timing - I had this problem today too!
I had opted for a similar solution when I found your question. I did some more digging to see what the root cause of this issue is:
Magento 1.7 CE/1.12 EE introduced this change.
app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
contains a function_filterStockData
that sets negative values ofmin_qty
to 0:The line in the 1.7.0.0 release notes for this is
Fixed: "Qty for Item's Status to Become Out of Stock" option works incorrect
.There is a similar function in the code for updating stock via the REST API.
There is a thread on the defunct magento boards about this, a poster mentions a bug report that was accepted to be fixed. I can't find any bug report. This still exists in 1.9 CE and 1.14 EE.
This behaviour exists in magento2.
I decided to override the
Mage_Adminhtml_Catalog_ProductController
controller to create a_filterStockData
function without the replacement ofmin_qty
.I wrote an extension to handle this and have put it up on Github here: https://github.com/etailer/etailer_backorders
I've not run in to any issues with negative values of
min_qty
yet.Update: Allowing negative
min_qty
doesn't limit the number of backorders that can be added to cart or sold. It also doesn't move products toout_of_stock
whenqty
=min_qty
.However I've added both these features to my extension so you can refer to that if you're after implementation ideas!