Skip to content

2020-11-06 - Creating events in Shopware

2020-11-06 - Creating events in Shopware


This document represents an architecture decision record (ADR) and has been mirrored from the ADR section in our Shopware 6 repository. You can find the original version here


Events throughout Shopware are quite inconsistent. It is not defined which data it must or can contain. This mainly depends on the domain where the events are thrown.


Developers should always have access to the right context of the current request, at least the Shopware\Core\Framework\Context should be present as property in events. If the event is thrown in a SalesChannel context, the Shopware\Core\System\SalesChannel\SalesChannelContext should also be present as property.


From now on every new event must implement the Shopware\Core\Framework\Event\ShopwareEvent interface. If a Shopware\Core\System\SalesChannel\SalesChannelContext is also available, the Shopware\Core\Framework\Event\ShopwareSalesChannelEvent interface must be implemented instead.