Hi, we are pretty new to Commerce. Please be nice
-
How can an order be canceled (=change state) via Commerce GUI inside the MODX Manager?
-
How can an order be deleted (=remove it totally)? (Only by directly manipulating the database?)
Thanks
Hi, we are pretty new to Commerce. Please be nice
How can an order be canceled (=change state) via Commerce GUI inside the MODX Manager?
How can an order be deleted (=remove it totally)? (Only by directly manipulating the database?)
Thanks
Hey @webaff, hope youâre having fun learning Commerce
To add an option to cancel an order, create a new âCancelledâ status assigned to the Cancelled state (if itâs not already there). Then create a Status Change from the Processing status to the Cancelled status. At that point you can change the status of an order to cancelled.
If that sounds like abracadabra, please take a look at the status documentation: https://docs.modmore.com/en/Commerce/v1/Statuses/index.html
Itâs not possible (and most likely never will be, at least not in the core) to completely remove orders. For accounting purposes itâs important that the data is accurate, complete, and sequential, and that canât be the case if orders can be removed.
If youâre looking to remove test data before going live: thatâs not needed. When enabling live mode, all test orders and transactions are automatically hidden and you essentially start with a clean slate.
If thatâs not enough, then yes, directly manipulating the database is a possibility, but I do strongly recommend against that. Itâs a potential can of worms. Related data is spread across different tables and if you forget to wipe one thing, that may come back to haunt you later when actual customers start making purchases. Youâll need to go through all commerce_ prefixed tables one-by-one to make sure itâs all truncated properly. (Also, depending on what payment provider you use, you may run into issues later where it refuses a transaction because it already saw the transaction ID before.)
Hi Mark, thank you for your reply.
@1.: Done.
@2.: Your answer and implementation makes totally sense to me. But unfortunately we went to live mode too early. Now we have about 20 test orders that we want to get rid of before going public. I will check with the client if we can leave them in the system.