Siso\Bundle\CheckoutBundle\Controller\AjaxCheckoutController) is the subcontroller responsible for Phalanx calls in the one-page checkout process.
AjaxCheckoutController first calls
validateStepAction() to calculate the current possible step depending on:
- form validation
- submitted data (checkboxes)
- customer data
- basket (e.g. calling
#summarywhen no delivery address is filled redirects to the delivery step)
How the steps are handled?¶
Siso/Bundle/CheckoutBundle/Api/CheckoutStepServiceInterface interface defines steps for handling the checkout process.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
The default implementation of this interface is
which ensures that the user is forwarded to the correct step and all necessary data is stored in the basket.
It checks whether the user is able to see the requested step. If they do not have the proper permissions,
they are forwarded to the last possible step.
The checkout steps are defined in the following method:
1 2 3 4 5 6 7 8 9 10
validateStepAction() uses this service to determine the correct step.
1 2 3 4 5
If you want to skip a step in the checkout process, override
When skipping steps, make sure that you store all required data in the basket.
1 2 3 4 5 6
validateStepAction() checkout events are thrown that enable you to interrupt the checkout process.
|customer data||anonymous||customer without number||customer with number|
This method displays the login form with possible options for registration and ordering as a guest.
form valid: true
|submitted data||invoiceAsDelivery checked||invoiceAsDelivery not checked|
form valid: false
|customer data||customer without no||else|
On success this method stores the invoice address in the basket.
invoiceAsDelivery checkbox is ticked, the method also stores the delivery address.
This method creates the form based on configuration and determines which
addressStatus radio button option should be chosen.
There are different scenarios for anonymous users, users without and with a customer number.
When the user has no default delivery address, the option to display existing addresses is disabled.
On success, the method stores the delivery address in the basket. If
saveAddress was checked it stores the address in
On success the method stores the shipping/payment method in the basket.
On success this method stores data in basket and copies the basket with state
Next, it redirects the user to order confirmation.
In this step, the total gross amount may be rounded to two decimal digits.
This is because the amount is used to process the payment later on and nearly all payment transaction don't allow values with more than two decimal digits.
You can disable this behavior by setting
Phalanx performs the following actions during the delivery step:
getExistingDelivery()is triggered with the delivery
addressStatusoption. It looks for customer delivery parties and fills the form with them. Sets the default address if no data set. Returns delivery template form.
getEmptyDelivery()is triggered with delivery
addressStatusoption. It returns an empty delivery template form.
getDeliveryFromInvoice()is triggered with delivery
addressStatusoption. It returns a delivery template form based on a previously filled invoice form.
validateStep() validates the step for which the request was made and returns the current step.
This prevents the user from reaching steps they shouldn't have access to.
Additionally, if the user is logged in with a customer number, the request to the ERP takes place to get the latest invoice address.
This prevents showing incorrect addresses in the basket for the user.
Overriding the controller¶
To override actions from
AjaxCheckoutController, create a new controller which extends
In the new controller you can reimplementend the actions.
Then, register the new controller as the controller for Ajax requests with the type
For more information, see Ajax (Phalanx).