You are here

public function CheckoutEventSubscriber::onCheckoutCompletion in Commerce Core 8.2

Creates a log when the customer completes checkout.

Parameters

\Drupal\commerce_order\Event\OrderEvent $event: The order event.

File

modules/log/src/EventSubscriber/CheckoutEventSubscriber.php, line 44

Class

CheckoutEventSubscriber

Namespace

Drupal\commerce_log\EventSubscriber

Code

public function onCheckoutCompletion(OrderEvent $event) {
  $order = $event
    ->getOrder();
  $this->logStorage
    ->generate($order, 'checkout_complete')
    ->save();
}