I have issues with executing the credit memo functionality in Magento. Sometimes it works and sometimes it doesn't.

So far I have been able to narrow it down to a call to this function


This can be found in app/code/core/Mage/Sales/Model/Order/Creditmemo.php inside a function called public function refund().

I am sure it is failing here because if I comment it out the credit memo will work. Also, in cases where the credit memo won't work, if I replace $baseOrderRefund with a hardcoded figure such as 20 for example it seems to work.

I am trying to find where this function is defined and find out exactly where the process is failing but I have been unable to find this function in the code. Can anyone point me the correct direction

  • Possibly a stupid question, but have you checked if the order is invoiced? I don't believe you can create a credit memo otherwise. Commented Dec 19, 2013 at 13:48
  • When you say can't create a credit memo on a non invoiced order, do you mean that it won't give the option or it will throw an error? Commented Dec 20, 2013 at 13:46

2 Answers 2


If you cant create a credit memo, may it be because of the following reasons:

  1. The invoice for that particular order has not been created.

  2. The grand total of that order is zero (may be after applying discount).

  3. Have you ticked the check-box that appears just above the refund amount ??(i.e whether to mail the customer the credit memo.) If Yes, then the email sending is failing and memo is not getting created.


It turned out to be a variable in an object. This was just a way of assigning it a value.

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.