Pimcore How to get event for first time product save using backend.
I have to apply some logic for first time product creation in pimcore.
How to find event name.
The name of the event is 'object.preAdd'.
If the Id of the saved object is 0, it's a newly created one
\Pimcore::getEventManager()->attach("object.preAdd", function (\Zend_EventManager_Event $e) { // your code goes here });
It would probably be best if you stick the code above into a custom made plugin to ensure it's executed on every call.
See https://www.pimcore.org/docs/latest/Extending_Pimcore/Event_API_and_Event_Manager.html for more information
The name of the event is 'object.preAdd'.
If the Id of the saved object is 0, it's a newly created one
It would probably be best if you stick the code above into a custom made plugin to ensure it's executed on every call.
See https://www.pimcore.org/docs/latest/Extending_Pimcore/Event_API_and_Event_Manager.html for more information