Submitted by Dmitro on Sun, 07/04/2024 - 21:38 Load Order and change it status to "Cancelled":$order = \Drupal::entityTypeManager() ->getStorage('commerce_order') ->load(1); $order->getState()->applyTransitionById('cancel'); $order->save(); drupal commerce