There are three kinds of events that can be thrown during checkout process:
||This event must be dispatched before user enters the checkout process|
||This event must be dispatched before form preparation in the checkout process|
||This event must be dispatched after form preparation in the checkout process|
Before the user enters the checkout process, the shop throws the
siso_checkout.pre_checkout event to enable checking the basket.
You can use it, for example, to check for invalid items in the basket.
If the event listener needs to interrupt the checkout process, it sets the event status to
failed and sets a custom error message in the basket.
It then redirects the user back to the basket and displays the error message.
ValidBasketListener (service ID:
siso_checkout.empty_basket_listener) checks if the basket is empty and the prices are valid.
If the prices are invalid, the customer cannot make an order.
You can allow making an order with invalid prices (for example for B2B), by setting
MinOrderAmountListener (service ID:
siso_checkout.min_order_amount_listener) checks if the minimum order amount was reached.
This is set in the configuration. You can also enable/disable the listener:
1 2 3
Before the form is rendered in the checkout, the shop throws the
siso_checkout.pre_form_checkout event to enable modifying the form.
You can, for example, modify payment or shipping options.
Change the shipping or payment options¶
If you want to change the shipping or payment options (e.g. you need to set them dynamically depending on the basket data),
implement the following listener and store the options in the basket
The options automatically appear in the checkout process.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
PriceShippingListener (service ID
siso_checkout.tests.price_shipping_listener) adds information about prices to shipping options:
After a form is submitted in the checkout, the shop throws the
to enable you to modify the submitted values and check them.
You can use it, for example, to validate the address.
For this to work, every checkout form must implement the
The validation has three options:
- status success - go to the next step
- status error - stay in the current step, display error message and display rendered HTML in the template above current form
- status notice - stay in the current step, display notice message and display rendered HTML in the template above current form
It adds checkbox to force next step in every checkout form. User has to check this checkbox if he wants to continue
ValidAddressListener (service ID
siso_checkout.tests.valid_address_listener) checks if address is valid.