You are here

function uc_googleanalytics_uc_order_create in Ubercart 8.4

Implements hook_uc_order_create().

File

uc_googleanalytics/uc_googleanalytics.module, line 50
Adds Google Analytics Javascript to the checkout completion page.

Code

function uc_googleanalytics_uc_order_create(OrderInterface $order) {

  // If a new order is created during the checkout process...
  // Store the order ID for later use.
  \Drupal::service('session')
    ->set('ucga_order_id', $order
    ->id());
}