diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f08b825..2cb06db 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -19,6 +19,8 @@ Ubercart 4.x
     * $order address properties => $order->getAddress() and $order->setAddress()
     * $order->currency => $order->getCurrency()
     * $order->payment_method => $order->getPaymentMethodId() and $order->setPaymentMethodId()
+    * uc_order_load_line_items() => $order->getLineItems()
+    * uc_order_load_line_items_display() => $order->getDisplayLineItems()
     * uc_order_is_shippable() => $order->isShippable()
     * uc_order_log_changes($order_id, $changes) => $order->logChanges($changes)
     * uc_order_can_view_order() => $order->access('view')
diff --git a/payment/uc_payment/lib/Drupal/uc_payment/Plugin/Ubercart/CheckoutPane/PaymentMethodPane.php b/payment/uc_payment/lib/Drupal/uc_payment/Plugin/Ubercart/CheckoutPane/PaymentMethodPane.php
index 6e62f85..ffa24c1 100644
--- a/payment/uc_payment/lib/Drupal/uc_payment/Plugin/Ubercart/CheckoutPane/PaymentMethodPane.php
+++ b/payment/uc_payment/lib/Drupal/uc_payment/Plugin/Ubercart/CheckoutPane/PaymentMethodPane.php
@@ -158,7 +158,7 @@ class PaymentMethodPane extends CheckoutPanePluginBase implements ContainerFacto
    * {@inheritdoc}
    */
   public function review(UcOrderInterface $order) {
-    $line_items = uc_order_load_line_items_display($order);
+    $line_items = $order->getDisplayLineItems();
     foreach ($line_items as $line_item) {
       $review[] = array('title' => $line_item['title'], 'data' => uc_currency_format($line_item['amount']));
     }
diff --git a/payment/uc_payment/uc_payment.module b/payment/uc_payment/uc_payment.module
index bda8937..23fa48e 100644
--- a/payment/uc_payment/uc_payment.module
+++ b/payment/uc_payment/uc_payment.module
@@ -66,7 +66,7 @@ function uc_payment_theme() {
  * Default template: uc-payment-totals.html.twig.
  */
 function template_preprocess_uc_payment_totals(&$variables) {
-  $variables['line_items'] = uc_order_load_line_items_display($variables['order']);
+  $variables['line_items'] = $variables['order']->getDisplayLineItems();
 
   foreach ($variables['line_items'] as $key => $line) {
     $variables['line_items'][$key]['title'] = filter_xss($line['title']);
diff --git a/payment/uc_paypal/uc_paypal.pages.inc b/payment/uc_paypal/uc_paypal.pages.inc
index 547db46..fe7ff0a 100644
--- a/payment/uc_paypal/uc_paypal.pages.inc
+++ b/payment/uc_paypal/uc_paypal.pages.inc
@@ -265,7 +265,7 @@ function uc_paypal_ec_review() {
 function uc_paypal_ec_review_form($form, &$form_state, $order) {
   if (module_exists('uc_quote') && variable_get('uc_paypal_ec_review_shipping', TRUE) && $order->isShippable()) {
     uc_checkout_pane_quotes('prepare', $order, NULL);
-    $order->line_items = uc_order_load_line_items($order);
+    $order->line_items = $order->getLineItems();
     $order->save();
 
     $result = uc_checkout_pane_quotes('view', $order, NULL);
diff --git a/shipping/uc_quote/uc_quote.module b/shipping/uc_quote/uc_quote.module
index 9457235..f147ab7 100644
--- a/shipping/uc_quote/uc_quote.module
+++ b/shipping/uc_quote/uc_quote.module
@@ -753,7 +753,7 @@ function uc_quote_apply_quote_to_order($form, &$form_state) {
       uc_quote_uc_order('save', $order, '');
 
       // Update line items.
-      $order->line_items = uc_order_load_line_items($order);
+      $order->line_items = $order->getLineItems();
       $form_state['order'] = $order;
 
       $form_state['rebuild'] = TRUE;
diff --git a/uc_cart/lib/Drupal/uc_cart/Form/CheckoutForm.php b/uc_cart/lib/Drupal/uc_cart/Form/CheckoutForm.php
index 2e274f9..241630d 100644
--- a/uc_cart/lib/Drupal/uc_cart/Form/CheckoutForm.php
+++ b/uc_cart/lib/Drupal/uc_cart/Form/CheckoutForm.php
@@ -87,7 +87,7 @@ class CheckoutForm extends FormBase {
     // callbacks of enabled panes have been invoked, because these may have
     // altered the order.
     if (!$processed) {
-      $order->line_items = uc_order_load_line_items($order);
+      $order->line_items = $order->getLineItems();
       $order->save();
     }
 
@@ -142,7 +142,7 @@ class CheckoutForm extends FormBase {
     }
 
     // Reload line items and save order.
-    $order->line_items = uc_order_load_line_items($order);
+    $order->line_items = $order->getLineItems();
     $order->save();
   }
 
diff --git a/uc_order/lib/Drupal/uc_order/Entity/UcOrder.php b/uc_order/lib/Drupal/uc_order/Entity/UcOrder.php
index e728239..5e4fe55 100644
--- a/uc_order/lib/Drupal/uc_order/Entity/UcOrder.php
+++ b/uc_order/lib/Drupal/uc_order/Entity/UcOrder.php
@@ -85,7 +85,7 @@ class UcOrder extends ContentEntityBase implements UcOrderInterface {
       uc_order_module_invoke('load', $order, NULL);
 
       // Load line items... has to be last after everything has been loaded.
-      $order->line_items = uc_order_load_line_items($order);
+      $order->line_items = $order->getLineItems();
     }
   }
 
@@ -172,6 +172,89 @@ class UcOrder extends ContentEntityBase implements UcOrderInterface {
   /**
    * {@inheritdoc}
    */
+  public function getLineItems() {
+    $items = array();
+
+    $result = db_query("SELECT * FROM {uc_order_line_items} WHERE order_id = :id", array(':id' => $this->id()));
+    foreach ($result as $row) {
+      $item = array(
+        'line_item_id' => $row->line_item_id,
+        'type' => $row->type,
+        'title' => $row->title,
+        'amount' => $row->amount,
+        'weight' => $row->weight,
+        'data' => unserialize($row->data),
+      );
+      \Drupal::moduleHandler()->alter('uc_line_item', $item, $this);
+      $items[] = $item;
+    }
+
+    // Set stored line items so hook_uc_line_item_alter() can access them.
+    // @todo Somehow avoid this!
+    $this->line_items = $items;
+
+    foreach (_uc_line_item_list() as $type) {
+      if ($type['stored'] == FALSE && empty($type['display_only']) && !empty($type['callback']) && function_exists($type['callback'])) {
+        $result = $type['callback']('load', $this);
+        if ($result !== FALSE && is_array($result)) {
+          foreach ($result as $line) {
+            $item = array(
+              'line_item_id' => $line['id'],
+              'type' => $type['id'],
+              'title' => $line['title'],
+              'amount' => $line['amount'],
+              'weight' => isset($line['weight']) ? $line['weight'] : $type['weight'],
+              'data' => isset($line['data']) ? $line['data'] : array(),
+            );
+            \Drupal::moduleHandler()->alter('uc_line_item', $item, $this);
+            $items[] = $item;
+          }
+        }
+      }
+    }
+
+    usort($items, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
+
+    return $items;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getDisplayLineItems() {
+    $temp = clone $this;
+    $line_items = $this->getLineItems();
+
+    $items = _uc_line_item_list();
+    foreach ($items as $item) {
+      if (!empty($item['display_only'])) {
+        $result = $item['callback']('display', $temp);
+        if (is_array($result)) {
+          foreach ($result as $line) {
+            $line_items[] = array(
+              'type' => $item['id'],
+              'title' => $line['title'],
+              'amount' => $line['amount'],
+              'weight' => isset($line['weight']) ? $line['weight'] : $item['weight'],
+              'data' => isset($line['data']) ? $line['data'] : array(),
+            );
+          }
+        }
+      }
+    }
+
+    foreach ($line_items as &$item) {
+      $item['formatted_amount'] = uc_currency_format($item['amount']);
+    }
+
+    usort($line_items, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
+
+    return $line_items;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getUser() {
     return $this->get('uid')->entity;
   }
diff --git a/uc_order/lib/Drupal/uc_order/UcOrderFormController.php b/uc_order/lib/Drupal/uc_order/UcOrderFormController.php
index 1784a99..b35ccd2 100644
--- a/uc_order/lib/Drupal/uc_order/UcOrderFormController.php
+++ b/uc_order/lib/Drupal/uc_order/UcOrderFormController.php
@@ -123,7 +123,7 @@ class UcOrderFormController extends ContentEntityFormController {
     }
 
     // Load line items again, since some may have been updated by the form.
-    $order->line_items = uc_order_load_line_items($order);
+    $order->line_items = $order->getLineItems();
 
     $order->logChanges($log);
 
diff --git a/uc_order/lib/Drupal/uc_order/UcOrderInterface.php b/uc_order/lib/Drupal/uc_order/UcOrderInterface.php
index b52b9f3..b15c167 100644
--- a/uc_order/lib/Drupal/uc_order/UcOrderInterface.php
+++ b/uc_order/lib/Drupal/uc_order/UcOrderInterface.php
@@ -16,6 +16,31 @@ use Drupal\uc_store\Address;
 interface UcOrderInterface extends ContentEntityInterface {
 
   /**
+   * Returns an array containing an order's line items ordered by weight.
+   *
+   * @return array
+   *   An array of line items, which are arrays containing the following keys:
+   *   - line_item_id: The line item id.
+   *   - type: The line item type.
+   *   - title: The line item title.
+   *   - amount: The line item amount.
+   *   - weight: The line item weight.
+   */
+  public function getLineItems();
+
+  /**
+   * Returns an order's line items ordered by weight, prepared for display.
+   *
+   * @return array
+   *   An array of line items, which are arrays containing the following keys:
+   *   - type: The line item type.
+   *   - title: The line item title.
+   *   - amount: The line item amount.
+   *   - weight: The line item weight.
+   */
+  public function getDisplayLineItems();
+
+  /**
    * Returns the order user entity.
    *
    * @return \Drupal\user\UserInterface
diff --git a/uc_order/uc_order.module b/uc_order/uc_order.module
index 2d52152..ec23ac7 100644
--- a/uc_order/uc_order.module
+++ b/uc_order/uc_order.module
@@ -629,114 +629,6 @@ function uc_order_comment_save($order_id, $uid, $message, $type = 'admin', $stat
 }
 
 /**
- * Returns an array containing an order's line items ordered by weight.
- *
- * @param $order
- *   An order object whose line items are to be loaded.
- * @param $stored
- *   Boolean flag. If TRUE, only line items stored in the database are loaded.
- *   If FALSE, only line items not stored in the database are loaded.
- *   This distinction is made because the non-stored line items may depend on
- *   the amounts of all of the stored line items.
- *
- * @return
- *   An array of line items, which are arrays containing the following keys:
- *   - line_item_id: The line item id.
- *   - type: The line item type.
- *   - title: The line item title.
- *   - amount: The line item amount.
- *   - weight: The line item weight.
- */
-function uc_order_load_line_items($order) {
-  $items = array();
-
-  $result = db_query("SELECT * FROM {uc_order_line_items} WHERE order_id = :id", array(':id' => $order->id()));
-  foreach ($result as $row) {
-    $item = array(
-      'line_item_id' => $row->line_item_id,
-      'type' => $row->type,
-      'title' => $row->title,
-      'amount' => $row->amount,
-      'weight' => $row->weight,
-      'data' => unserialize($row->data),
-    );
-    \Drupal::moduleHandler()->alter('uc_line_item', $item, $order);
-    $items[] = $item;
-  }
-
-  // Set stored line items so hook_uc_line_item_alter() can access them.
-  $order->line_items = $items;
-
-  foreach (_uc_line_item_list() as $type) {
-    if ($type['stored'] == FALSE && empty($type['display_only']) && !empty($type['callback']) && function_exists($type['callback'])) {
-      $result = $type['callback']('load', $order);
-      if ($result !== FALSE && is_array($result)) {
-        foreach ($result as $line) {
-          $item = array(
-            'line_item_id' => $line['id'],
-            'type' => $type['id'],
-            'title' => $line['title'],
-            'amount' => $line['amount'],
-            'weight' => isset($line['weight']) ? $line['weight'] : $type['weight'],
-            'data' => isset($line['data']) ? $line['data'] : array(),
-          );
-          \Drupal::moduleHandler()->alter('uc_line_item', $item, $order);
-          $items[] = $item;
-        }
-      }
-    }
-  }
-
-  usort($items, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
-
-  return $items;
-}
-
-/**
- * Returns an order's line items ordered by weight, prepared for display.
- *
- * @param $order
- *   An order object whose line items are to be loaded.
- *
- * @return
- *   An array of line items, which are arrays containing the following keys:
- *   - type: The line item type.
- *   - title: The line item title.
- *   - amount: The line item amount.
- *   - weight: The line item weight.
- */
-function uc_order_load_line_items_display($order) {
-  $temp = clone $order;
-  $line_items = uc_order_load_line_items($order);
-//  $temp->line_items = &$line_items;
-
-  $items = _uc_line_item_list();
-  foreach ($items as $item) {
-    if (!empty($item['display_only'])) {
-      $result = $item['callback']('display', $temp);
-      if (is_array($result)) {
-        foreach ($result as $line) {
-          $line_items[] = array(
-            'type' => $item['id'],
-            'title' => $line['title'],
-            'amount' => $line['amount'],
-            'weight' => isset($line['weight']) ? $line['weight'] : $item['weight'],
-            'data' => isset($line['data']) ? $line['data'] : array(),
-          );
-        }
-      }
-    }
-  }
-  foreach ($line_items as &$item) {
-    $item['formatted_amount'] = uc_currency_format($item['amount']);
-  }
-
-  usort($line_items, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
-
-  return $line_items;
-}
-
-/**
  * Invokes hook_uc_order() in every module.
  *
  * We cannot use module_invoke() for this, because the arguments need to
@@ -827,7 +719,7 @@ function template_preprocess_uc_order_invoice(&$variables) {
     }
   }
 
-  $variables['line_items'] = uc_order_load_line_items_display($variables['order']);
+  $variables['line_items'] = $variables['order']->getDisplayLineItems();
   $order->line_items = $variables['line_items'];
 
   // Generate tokens to use as template variables.
diff --git a/uc_order/uc_order.order_pane.inc b/uc_order/uc_order.order_pane.inc
index 827d016..a30afa4 100644
--- a/uc_order/uc_order.order_pane.inc
+++ b/uc_order/uc_order.order_pane.inc
@@ -864,7 +864,7 @@ function uc_order_pane_line_items_add($form, &$form_state) {
   $type = $form_state['values']['li_type_select'];
 
   uc_order_line_item_add($order->id(), $type, _uc_line_item_data($type, 'title'), 0);
-  $order->line_items = uc_order_load_line_items($order);
+  $order->line_items = $order->getLineItems();
 
   $form_state['rebuild'] = TRUE;
 }
@@ -877,7 +877,7 @@ function uc_order_pane_line_items_remove($form, &$form_state) {
   $line_item_id = intval($form_state['triggering_element']['#return_value']);
 
   uc_order_delete_line_item($line_item_id);
-  $order->line_items = uc_order_load_line_items($order);
+  $order->line_items = $order->getLineItems();
 
   $form_state['rebuild'] = TRUE;
 }
