Delete all empty orders on user login Case: Delete all empty orders for a user when he/she login to the website.

We are using drupal commerce.

Please Help.
It seems that these orders, where in the shopping cart when the current user log off, and never proceed to pay. In order to not lose this product in the cart for the next login, there has to be a relation to the user and product. 

If your eCommerce module doesn't have any configuration to delete products on logout, try using hook_user_logout


  Note that when this hook is invoked, the changes have not yet been written to the database, because a database transaction is still in progress. The transaction is not finalized until the save operation is entirely completed and user_save() goes out of scope. You should not rely on data in the database at this time as it is not updated yet. You should also note that any write/update database queries executed from this hook are also not committed immediately.