Feature: 337 - Split Up ProcessOrderCreateEvent 

See Issue 337

Description 

In order to better integrate the EventListener in connection with payment providers, the ExtcodeCartEventProcessOrderCreateEvent was split into several events. These implement a new EventInterface and also the PsrEventDispatcherStoppableEventInterface.

The new events in the order of their dispatch:

  • ExtcodeCartEventOrderCreateEvent
  • ExtcodeCartEventOrderStockEvent
  • ExtcodeCartEventOrderPaymentEvent
  • ExtcodeCartEventOrderFinishEvent

The new events can be activated via a feature toggle in LocalConfiguration.php or AdditionalConfiguration.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['SplitUpProcessOrderCreateEvent'] = true;
Copied!

The cart extension itself currently registers ExtcodeCartEventListenerProcessOrderCreateOrder and ExtcodeCartEventListenerProcessOrderCreateOrder on ExtcodeCartEventOrderCreateEvent. And the extension registers ExtcodeCartEventListenerProcessOrderCreateEmail and ExtcodeCartEventListenerProcessOrderCreateClearCart on ExtcodeCartEventOrderFinishEvent.

The product extensions extcode/cart-products, extcode/cart-events, and extcode/cart-books will register the EventListeners to ExtcodeCartEventOrderStockEvent.

The payment methods provider extensions should be registered to the ExtcodeCartEventOrderPaymentEvent. These should return true for the isPropagationStopped() if the payment process cannot be completed immediately, to prevent sending emails and clearing the cart session directly. The emails and clearing cart is then the responsibility of the extension. Of course, the extension itself can send appropriate events and the EventListener from this extension can be registered to it.

Impact 

If the feature toggle has been activated, the event ExtcodeCartEventProcessOrderCreateEvent will no longer be triggered. All EventListeners registered to this event must be registered to one of the new events.