Release inventory for unpaid products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I got this. There are orders which are already cancelled are cancelled again hence it throws this error.

I have put a filter to remove orders which are already cancelled.

So only non cancelled and payment status as pending will be cancelled.

I also want to persist these order to a table
How can. I do that
5 years ago
Oh yes that is correct.

Do you mean you want to copy these orders to another table for backup ?

Orders that are cancelled and deleted are not really deleted from the Orders table. There is just a deleted field that is set so they are no longer able to be displayed. So to get that order back again you just need to make a function to undelete (or uncancel - set status back to complete) an order.

If I understand your request correctly this would give you the same functionality
5 years ago
I understand that its not actually deleted, but I want to see them seperately which are deleted by scheduled task, can I check that in this table which one are actually cancelled by user and which one by system ?
5 years ago
Not as such.
You could duplicate the orders table and wrapper code and copy the order into the "OrdersCancelled" table but it seems like overkill just for this purpose.

An easy way to get this same info would be to log an activity when you cancel / delete an order.
i.e

Insted of

            _customerActivityService.InsertActivity("DeleteOrder", _localizationService.GetResource("ActivityLog.DeleteOrder"), order.Id);

Do something like

_customerActivityService.InsertActivity("OrderCancelledByScheduledTask",
          _localizationService.GetResource("ActivityLog.OrderCancelledByScheduledTask"), order.Id);
5 years ago
Thanks so much for the reply, you have again helped, solve my problem.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.