I'm using payu for Payment and it works good. When customer place an order, it goes to payu page to fill the details. If the customer don't want to pay, they simply close the window.

If the browser window is closed, the order status become still "pending" or "processing". The problem is the stock availability and quantity couldn't revert. I just found the solution to cancel the order using cron job after some time interval.

I reffered the links,

  1. http://inchoo.net/magento/cancel-pending-orders/
  2. https://stackoverflow.com/questions/11079915/how-to-change-the-order-state-programmatically-inside-a-cron-job
  3. https://nikunjvadariya.wordpress.com/2014/03/22/magento-change-order-status-automaticaly-after-selected-days-using-crontabjob/

I'm using magento 1.9.1 and couldn't find the better solution. Please help me here.

1 Answer 1


I would suggest a cron job and a script to cancel pending orders every any time you want

I don't suggest a module and observer after order placement because when your customer leaves for your money booker the order placement already happened. That precious X minutes your customer trying to complete the payment can't be predicted to include it in a module.

As a matter of fact you may have problems if the order collection you are going to make contains an order placing the time the script runs, so you may want to exclude the last orders.

Decide those numbers depending on your needs. Sadly I'm on mobile and I can't provide you any cost right now.

  • 1
    Thanks a lot. Basically, I'm new to magento and little tedious to write code.. Can you please suggest me code level integration?
    Oct 25, 2016 at 6:21

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.