diff --git a/module/VuFind/src/VuFind/Controller/CartController.php b/module/VuFind/src/VuFind/Controller/CartController.php
index 49cbba6cd9f636d4c4041bca695c86aa8e185bd8..b37b06078b73078c1dceb199759bdc4c2b3af1bd 100644
--- a/module/VuFind/src/VuFind/Controller/CartController.php
+++ b/module/VuFind/src/VuFind/Controller/CartController.php
@@ -77,6 +77,13 @@ class CartController extends AbstractBase
         // when we're done:
         $this->session->url = $this->getLightboxAwareUrl('cart-home');
 
+        // If the cart is disabled, going to cart home is not going to help us;
+        // use the referer instead.
+        if (!$this->getCart()->isActive()) {
+            $this->session->url
+                = $this->getRequest()->getServer()->get('HTTP_REFERER');
+        }
+
         // Now forward to the requested action:
         if (strlen($this->params()->fromPost('email', '')) > 0) {
             $action = 'Email';