At Magento, I am developing a commission module that I need to pay with my agents when sales are completed, and not when the order is placed.
Ideally, I would like to capture it when the state of order becomes "complete", but I did not find an observer for this?
I could add this to the shipping supervisor, but the order may have several batches and therefore is not correct.
Alternatively, I could always run the cron job to calculate the order in the last hour, but again it doesn't seem to be correct.
Any suggestions on how to do this correctly.
source share