Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check select shipping state should be applied #169

Open
markjan opened this issue Jun 18, 2021 · 0 comments
Open

Check select shipping state should be applied #169

markjan opened this issue Jun 18, 2021 · 0 comments

Comments

@markjan
Copy link

markjan commented Jun 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant