To get checkouts and manage them, use the
CheckoutServiceInterface, you manipulate checkouts that are stored in sessions.
Checkouts are containers for the
and all the data provided at each step of the configurable checkout process.
The checkout process relies on Symfony Workflow, and you can customize each of its steps.
Each checkout step has its own controller that allows adding forms and external API calls
that process data and pass them to
Completing a step results in submitting a form and updating the current checkout object.
At this point Symfony Workflow advances, the next controller takes over, and the
whole process continues.
From the developer's perspective, checkouts are referenced with an UUID identifier.
Get single checkout by identifier¶
To access a single checkout, use the
Get single checkout for specific cart¶
To fetch checkout for a cart that already exists, use the
It can be useful when you want to initiate the checkout process right after
products are successfully added to a cart.
1 2 3 4
To create a checkout, use the
CheckoutServiceInterface::createCheckout method and
provide it with a
CheckoutCreateStruct struct that contains a
1 2 3 4 5 6
You can update the collected data after the checkout is created.
The data is stored within the
The last update time and status are also stored.
To update the checkout, use the
and provide it with the
CheckoutUpdateStruct struct that contains data collected at each
step of the workflow, as well as a transition name to identify what step will follow.
All data is placed in session storage.
To delete a checkout from the session, use the