Just trying to get my head around the order flow in magento. I noticed magento deduct the qty of products when customer press "Place Order" botton. for orders with "COD" payment it seems fine, but what about orders with online payment, what if customer went to gateway and click cancel or close the page.
There are number of solution i read about. e.g. creating a cron job that cancel orders with unsuccessfull payments,...
But what i interest me more, is this this option at System>Configuartion>Inevntory>Decrease Stock When Order is Placed.
I wonder set this option to "No" and then deduct product qty when user successfuly came back from my gateway.
But then what i should i do for cod payments? is it possible to manually change the behaviour only for online payments? or vice versa for COD methods?
i'm kinda newbie at magento and any guide on my thoughts about this would be approciated.
For your requirements you need to customize the Magento flow. Using Magento different event observer, you can change the value of that configuration when desired payment method is selected.
And again, set the default status when the order is completed.
Be careful while coding for this because you changing the Magento default flow.