How do I get the order_id and order_number on the checkout completed page? I'm trying to get the order information inside the mymodule_preprocess_page hook.
On the normal page I can get it via the $cart. But the $cart is not available on the checkout page anymore. How do I get the order information specifically the order_id and order_number.
This is what I do on other pages:
  $order_type = 'physical';
  $cart_provider = \Drupal::service('commerce_cart.cart_provider');
  $store = \Drupal::service('commerce_store.current_store')-&gt;getStore();
  $cart = $cart_provider-&gt;getCart($order_type, $store);
  if ($cart) {
    foreach ($cart-&gt;getItems() as $order_item) {
      $orderId = $order_item-&gt;get('purchased_entity')[0]-&gt;get('target_id')-&gt;getValue();
  }
The following should work:

  /** @var \Drupal\commerce_order\Entity\OrderInterface $order */
  $order = \Drupal::routeMatch()-&gt;getParameter('commerce_order');