We have implemented one local solutions for Magento invoices, where there is an unique code on every Magento invoice (this is according to our local law). We see that now every default Magento invoice has that unique code. After the installation of extension, we have embeded that code in Abstract.php to be dispalyed in all invoices that are generated.

We will now like to seperate Magento invoices and leave classic Magento invoices for all payment methods besides credit card payment. As we are Magento starters, we dont have deep understanding of Magento invoices, so we need some informations:

  1. Does someone have a good links / resources on magento invoices part to learn from?

  2. What is the general logic behind Magento invoices? Can someone briedly explain how they work, and what is used from Magento to generate one invoice?

  3. We need to implement somehow if condition (if paymentmethod credit card, then use special invoices with code from extension, if not then use regular magento invoices). On the Magento invoice files, where are the points the payment methods are defined. What will we need to change and do to split these invoices?

  • 2
    Isn't the Invoice increment ID a unique code? Or do you need a specific code? Aug 23, 2013 at 14:12

1 Answer 1


The logic in a magento proces.

  • Customer places item in cart.
  • Quote is generated with own quote id.
  • Customer checks out payment via cart.

Two possibilities.

Payment via eft:

  • Electronic transaction details are generated.
  • Customer is shipped to payment service provider with quote id as payment reference.
  • Invoice is generated and set to pending payment referencing to quote origins and payment details
  • transaction details are returned from payment service provider.
  • Transaction details are updated.
  • if transaction was successful invoice is set to paid and order status is changed to processing.

Payment via invoice/Cheques

  • the invoice needs to be generated by hand by default

  • set to paid manually via the admin panel,

    but basically same process as above.

  • Well I know the general logic. I was hoping from somone to explain backend logic.
    – xul
    May 25, 2013 at 0:50
  • This is the backend logic. At least also the database logic... how it's handled by the php I wouldn't dare say. May 27, 2013 at 10:07
  • I dont have shipment. I have internal credit card payments on checkout so there is no forwarding. This has nothing to do with the Magento invoice creation logic.
    – xul
    May 28, 2013 at 12:39

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.