Situation: Stock = 0, in_stock = no Then I process a credit note. Stock = 1, in_stock = no

I would expect the in_stock to be set back to yes. The effect of this is that we have many T-shirts in 1 size of 1 SKU that apparently were returned some day - and now not seen in the store (so not sold). So they are in stock with qty 1, but their flag in_stock is still NO

Question: Is there a solution for this?

1 Answer 1


I found this:

"I know it's old but because this isn't yet fixed not even in I came up with a better solution.

Tested on 1.5.1 and above:



public function refundOrderInventory($observer)"


//add this
foreach ($creditmemo->getAllItems() as $item) {
    $productId = $item->getProductId();
    $product = Mage::getModel('catalog/product')->load($productId);


        $stockItem = $product->getStockItem();



It was taken from https://stackoverflow.com/questions/10453324/magento-credit-memo-return-to-stock-not-updating-stock-availability and they also say another possible solution (although less effective) is found here: http://wrightcreativelabs.com/blog/55-credit-memo-in-stock.html

Does this help?

  • Super. Maybe shoot in as a bug fix too
    – snh_nl
    Dec 23, 2014 at 18:40

Your Answer

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

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