public function OrderEventsSubscriber::onOrderCreate in Commerce Demo 8
Reacts to an order being created..
Parameters
\Drupal\commerce_order\Event\OrderEvent $event: The order event.
File
- src/
EventSubscriber/ OrderEventsSubscriber.php, line 25
Class
Namespace
Drupal\commerce_demo\EventSubscriberCode
public function onOrderCreate(OrderEvent $event) {
$order = $event
->getOrder();
if ($order
->getCustomer()
->isAnonymous()) {
$order
->setEmail(sprintf('demo+%s@commercekickstart.com', time()));
}
}