This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Discounts events¶
Discount management¶
The events below are dispatched when managing discounts:
Form events¶
Form¶
The events below allow you to customize the discounts creation wizard:
Form steps¶
The following events are dispatched when rendering each step of the discount wizard, allowing you to add new fields to it:
Event | Event name |
---|---|
CreateFormDataEvent | ibexa.discounts.form_mapper.<step_identifier>.create_form_data |
MapCreateDataToStructEvent | ibexa.discounts.form_mapper.<step_identifier>.map_create_data_to_struct |
MapDiscountToFormDataEvent | ibexa.discounts.form_mapper.<step_identifier>.map_discount_to_form_data |
MapUpdateDataToStructEvent | ibexa.discounts.form_mapper.<step_identifier>.map_update_data_to_struct |
The event classes are shared between steps, but they are dispatched with different names. Each step form mapper dispatches its own set of events.
Back office¶
These events are dispatched by the back office controllers after user chooses the "Save" action when creating or updating a discount.
Event | Dispatched by | Description |
---|---|---|
PreDiscountCreateEvent | Ibexa\Bundle\Discounts\Controller\DiscountCreateController |
Dispatched when the discount creation is finished in the back office form |
PreDiscountUpdateEvent | Ibexa\Bundle\Discounts\Controller\DiscountEditController |
Dispatched when the discount modifications is finished in the back office form |
Discount codes¶
The event below allows you to inject your custom logic before the discount code is applied to a product in cart:
Event | Dispatched by | Description |
---|---|---|
BeforeDiscountCodeApplyEvent | Ibexa\Bundle\DiscountsCodes\Controller\REST\DiscountCodeController |
Dispatched before a discount code is applied in the cart |