Closed
Description
Summary
When placing an observer on sales_order_state_change_before
, it's not possible to get any data from the actual order object.
Examples
see \Magento\Sales\Model\Service\OrderService->setState()
:
Current code is:
$this->eventManager->dispatch( 'sales_order_state_change_before', ['order' => $this, 'transport' => $transport] );
Because $this
is passed to the observer, and not $order
, there's no way to get order data in the observer.
Proposed solution
Change event dispatch either to 'order' => $order
, or add 'order_object'
to have it backwards compatible.
$this->eventManager->dispatch( 'sales_order_state_change_before', ['order' => $this, 'transport' => $transport, 'order_object' => $order] );
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done