Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Check select shipping state should be applied #169

@markjan

Description

@markjan

When creating an order using this plugin for a ProductVariant with shippingRequired = false I get an exception SMException in \Sylius\AdminOrderCreationPlugin\EventListener\OrderCreationListener::completeOrderBeforeCreation because the 'select_shipping' state can not be applied.

I suggest checking that state can be applied first as is done for the payment in the lines below:

if($stateMachine->can(OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING)) {
   $stateMachine->apply(OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING);
}

I can send you a path for the class and spec if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions