Customizing State Machines
How to find the desired state machine to customize?
Locate the Workflow Graph
Sylius\Component\Core\OrderCheckoutTransitions::GRAPHExplore Defined Workflows
php bin/console debug:config framework workflows | grep sylius_Extending the existing workflows
Add a New State
Add a New Transition
Result:
Removing Transitions and States
Example 1: Remove the skip_shipping Transition
skip_shipping TransitionExample 2: Remove the shipping_skipped State
shipping_skipped StateRegister Compiler Passes
Extending the existing Transitions
Create a compiler pass:
Register it in your Kernel.php:
Kernel.php:Result:
Adding Workflow Callbacks
Example: Send an Email After Order Completion
Overriding Existing Workflow Listeners
Example: Customize Shipping State Resolver
🔧 Debug Your Workflow Setup
Optional: Legacy Winzou State Machine
Last updated
Was this helpful?
