Impossible to cancel an order

Created on 29 December 2022, almost 2 years ago
Updated 16 August 2023, about 1 year ago

In some cases admin may need to cancel an order

As I describe in this post it's sometimes necessary for admin to cancel an order :

https://drupal.stackexchange.com/questions/314165/how-to-cancel-a-commerce-order

This post still remains unanswered, which seems surprising to me.

This operation was possible with Commerce 1, I used it from time to time when a customer asserted his right of withdrawal, for example.

Today, I'm having trouble with a payment module that accepts payments that aren't validated by the payment gateway. So I have to cancel these payments and I can't find any solution to do it even programmatically.

Did I miss something? or is this possibility really not considered in the commerce workflow.

If so, this should be considered urgently as it is an important need for administrators of an e-commerce site.

πŸ’¬ Support request
Status

Fixed

Version

2.32

Component

Order

Created by

πŸ‡«πŸ‡·France alexdezark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Same requirement came up once again: πŸ’¬ Impossible to cancel an order Fixed

    Please read the comments over there. While a returned order should indeed not be "canceled", but "returned" or something like this, there are still cases where it's indeed canceled. I really think we should reopen this discussion (but not as major). Or leave the other issue open, if that fits better.

  • πŸ‡ΊπŸ‡ΈUnited States lisastreeter

    The behavior of an existing Commerce order workflow should not be changed. Existing commerce sites already running in production will have custom Event subscribers, Guards, etc. Moving an order to the "Completed" state may trigger business logic like invoicing. (Or affect other business logic related to inventory, accounting, etc., as mentioned above.)

    Existing e-commerce sites should not be forced to rework their working/tested custom code so that some new Drupal Commerce websites can have a workflow that allows cancelation from the Completed state.

    Especially when it is very simple to create a new workflow. Yes, a custom module is needed. But it's just some configuration yaml, not custom code or anything complex. Just one folder for the module, one yaml file to define the module, and one yaml file for the workflow: https://docs.drupalcommerce.org/commerce2/developer-guide/orders/workflo...
    No actual "coding" is needed. Just start with a copy of an existing workflow and modify it as you like, with a new name/label.

    (For various logic to work as is in Commerce Core, you should keep the 'draft' 'canceled', 'completed' state IDs as is as well as the 'place' transition.)

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @lisastreeter also totally agree with that, but don't agree that "Completed" is the only "End".

    You're right that it might not be the same end and we should talk about a different "canceled" here, as written in https://www.drupal.org/project/commerce/issues/3381411#comment-15194858 ✨ Allow canceling a completed order (Workflows) Closed: duplicate but I'm fine with the custom workflows, just wanted to add that I see cases where it would make sense to have the chance to have one more state behind / besides completed.

Production build 0.71.5 2024