John Davidson

php - Subscribe to Event which does not have an event name


I try to subscribe to the Event in Shopware 6.3.5


The class does not define an EVENT_NAME, which I seem to need according to the docs:

public static function getSubscribedEvents(): array
// Return the events to listen to as array like this: <event to listen to> => <method to execute>
return [
ProductEvents::PRODUCT_LOADED_EVENT => 'onProductsLoaded'

What do I enter as array key for the subscribed events now?

My Answer:
return [
ImportExportBeforeImportRecordEvent::class => 'onImportExportBeforeImportRecord',

Rate this post

4 of 5 based on 1065 votes


© 2024 - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us