An event that triggers when an order is created.
The onOrderCreated()
event handler runs when an order is created.
The received OrderCreatedEvent
object contains information about the created order.
This event handler runs for both online orders and offline orders.
Note: Backend events don't work when previewing your site.
Information about the created order and metadata for the event.