Getting started

We are going to create a checkout flow resolver which inspects the customer's order. The goal of our checkout flow resolver is to see if the order contains both physical and digital goods. If the order contains both types of products, we're going to provide a checkout flow plugin that should be used. This will then be the checkout flow plugin used, ensuring our customer has the correct checkout experience.

By default, a checkout flow uses the one configured on the order type. By following this tutorial you could rely on a single order type instead of multiple order types (one for physical, one for digital.)

To keep the tutorial short, we are going to assume there are the following checkout flows configured:

Digital (machine name: digital)

Shipping (machine name: shipping)

Mixed order (machine name: mixed_order)

You should also have a custom module, which we will refer to as mymodule.