Step logic

The LokiCheckout supports multiple steps and advanced customizations to the step logic. This page documents most vital information you need for this.

Adding new steps

Steps are nothing more than child blocks to the parent block loki-checkout.steps. They do not need to be registered, except for the fact that they need to be a LokiComponent with a ViewModel that implements LokiCheckout\Core\Component\Checkout\Step\StepViewModelInterface.

The step button component

The step button (forward or backward) is a Loki Component, so it is rendered via ComponentViewModel and whenever the button is hit, a POST message is sent via AJAX to Magento, where it is handled by the ComponentRepository. In the case of the forward button, this is \Yireo\LokiCheckout\Component\Checkout\StepButton\StepForwardButton\StepForwardButtonRepository. There, logic is handed over to the \Yireo\LokiCheckout\Step\StepNavigator to navigate to the next step. Each step allows validation, so that is validation fails, the next step is never navigated to.

A special story deals with the final step (as in: when the current step is actually the last step in the checkout). At this moment, the step navigator calls upon \Yireo\LokiCheckout\Step\FinalStep which validates (calling upon the regular quote validator) and submits the last details. For instance, the quote is converted into an order, events are being dispatched, an email is being sent, etcetera.

More docs coming soon
Last modified: August 11, 2025