diff --git a/uc_cart/uc_cart.module b/uc_cart/uc_cart.module
index b8f5a6c..98cdfab 100644
--- a/uc_cart/uc_cart.module
+++ b/uc_cart/uc_cart.module
@@ -431,49 +431,34 @@ function uc_cart_get_contents($cid = NULL, $action = NULL) {
     return array();
   }
 
-  if ($action == 'rebuild' || $action == 'empty') {
-    unset($items[$cid]);
-    // Mark the current cart order (if any) as needing to be rebuilt.  We only
-    // do this if the cart is being explicitly rebuilt (i.e. after an item is
-    // added, removed or altered).
-    $_SESSION['uc_cart_order_rebuild'] = TRUE;
-  }
-
-  if (!isset($items[$cid])) {
-    // Find all cart items associated with this cart.
-    if ($action != 'empty') {
-      $result = Drupal::entityQuery('uc_cart_item')
-        ->condition('cart_id', $cid)
-        ->sort('cart_item_id', 'ASC')
-        ->execute();
-      if (!empty($result)) {
-        $items[$cid] = entity_load_multiple('uc_cart_item', array_keys($result), TRUE);
-
-        // Create a bare order and attach it to each item as context.
-        $order = entity_create('uc_order', array(
-          'uid' => $cid,
-        ));
-        foreach ($items[$cid] as $item) {
-          $item->order = $order;
-        }
-      }
-      else {
-        $items[$cid] = array();
-      }
-    }
-    else {
-      $items[$cid] = array();
+  if (!isset($items[$cid]) || $action == 'rebuild') {
+    $items[$cid] = array();
+
+    $result = Drupal::entityQuery('uc_cart_item')
+      ->condition('cart_id', $cid)
+      ->sort('cart_item_id', 'ASC')
+      ->execute();
+
+    if (!empty($result)) {
+      $items[$cid] = entity_load_multiple('uc_cart_item', array_keys($result), TRUE);
     }
 
     // Allow other modules a chance to alter the fully loaded cart object.
     \Drupal::moduleHandler()->alter('uc_cart', $items[$cid]);
 
-    // When there are no longer any items in the cart, the anonymous cart ID is
-    // no longer required. To guard against unsetting the session ID in the
-    // middle of an uc_cart_add_item() call, we only do this on rebuild.
-    // See issue 858816 for details.
-    if (($action == 'empty' || $action == 'rebuild') && empty($items[$cid]) && isset($_SESSION['uc_cart_id']) && $_SESSION['uc_cart_id'] == $cid) {
-      unset($_SESSION['uc_cart_id']);
+    if ($action == 'rebuild') {
+      // Mark the current cart order (if any) as needing to be rebuilt.  We only
+      // do this if the cart is being explicitly rebuilt (i.e. after an item is
+      // added, removed or altered).
+      $_SESSION['uc_cart_order_rebuild'] = TRUE;
+
+      // When there are no longer any items in the cart, the anonymous cart ID is
+      // no longer required. To guard against unsetting the session ID in the
+      // middle of an uc_cart_add_item() call, we only do this on rebuild.
+      // See issue 858816 for details.
+      if (empty($items[$cid]) && isset($_SESSION['uc_cart_id']) && $_SESSION['uc_cart_id'] == $cid) {
+        unset($_SESSION['uc_cart_id']);
+      }
     }
   }
 
