diff --git a/src/EventListener/OrderCreationListener.php b/src/EventListener/OrderCreationListener.php index 0eb9cec1..83752ef2 100644 --- a/src/EventListener/OrderCreationListener.php +++ b/src/EventListener/OrderCreationListener.php @@ -41,7 +41,9 @@ public function completeOrderBeforeCreation(GenericEvent $event): void $stateMachine = $this->stateMachineFactory->get($order, 'sylius_order_checkout'); $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_ADDRESS); - $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING); + if ($stateMachine->can(OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING)) { + $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING); + } if ($stateMachine->can(OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT)) { $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT); }