diff --git a/uc_cart/templates/uc-cart-block-title.html.twig b/uc_cart/templates/uc-cart-block-title.html.twig
new file mode 100644
index 0000000..d9f97dc
--- /dev/null
+++ b/uc_cart/templates/uc-cart-block-title.html.twig
@@ -0,0 +1,31 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display the shopping cart block title.
+ *
+ * Available variables:
+ * - title: The text to use for the title of the block.
+ * - show_icon: TRUE if the cart icon is to be displayed.
+ * - empty: TRUE if the cart is empty.
+ * - collapsible: TRUE if the cart block is collapsible.
+ * - collapsed: TRUE if the cart block is collapsed initially.
+ * - cart_url: The URL of the cart page.
+ *
+ * @see uc_cart_preprocess_block()
+ * @see template_preprocess_uc_cart_block_title()
+ *
+ * @ingroup themeable
+#}
+{% if show_icon and cart_empty %}
+  <a href="{{ cart_url }}"><span class="cart-block-icon empty" title="{{ 'View your shopping cart.'|t }}"></span></a>
+{% elseif show_icon %}
+  <a href="{{ cart_url }}"><span class="cart-block-icon" title="{{ 'View your shopping cart.'|t }}"></span></a>
+{% endif %}
+
+{% if collapsible and collapsed %}
+  <span class="cart-block-arrow collapsed" title="{{ 'Show/hide shopping cart contents.'|t }}">{{ title }}</span>
+{% elseif collapsible %}
+  <span class="cart-block-arrow" title="{{ 'Show/hide shopping cart contents.'|t }}">{{ title }}</span>
+{% else %}
+  {{ title }}
+{% endif %}
diff --git a/uc_cart/uc_cart.module b/uc_cart/uc_cart.module
index 7efbfc9..613ff85 100644
--- a/uc_cart/uc_cart.module
+++ b/uc_cart/uc_cart.module
@@ -75,7 +75,7 @@ function uc_cart_theme() {
         'collapsible' => TRUE,
         'collapsed' => TRUE,
       ),
-      'file' => 'uc_cart.theme.inc',
+      'template' => 'uc-cart-block-title',
     ),
     'uc_cart_block' => array(
       'variables' => array(
@@ -200,6 +200,15 @@ function uc_cart_preprocess_block(&$variables) {
 }
 
 /**
+ * Prepares variables for the cart block title template.
+ *
+ * Default template: uc-cart-block-title.html.twig.
+ */
+function template_preprocess_uc_cart_block_title(&$variables) {
+  $variables['cart_url'] = url('cart');
+}
+
+/**
  * Implements hook_uc_message().
  */
 function uc_cart_uc_message() {
diff --git a/uc_cart/uc_cart.theme.inc b/uc_cart/uc_cart.theme.inc
index 9a0339e..28294be 100644
--- a/uc_cart/uc_cart.theme.inc
+++ b/uc_cart/uc_cart.theme.inc
@@ -5,46 +5,6 @@
  * Theme functions for the uc_cart module.
  */
 
-use Drupal\Core\Template\Attribute;
-
-/**
- * Themes the shopping cart block title.
- *
- * @param $variables
- *   An associative array containing:
- *   - title: The text to use for the title of the block.
- *   - show_icon: TRUE if the cart icon is to be displayed.
- *   - empty: TRUE if the cart is empty.
- *   - collapsible: TRUE if the cart block is collapsible.
- *   - collapsed: TRUE if the cart block is collapsed initially.
- *
- * @ingroup themeable
- */
-function theme_uc_cart_block_title($variables) {
-  $output = '';
-
-  // Add in the cart image if specified.
-  if ($variables['show_icon']) {
-    $icon_attributes['title'][] = t('View your shopping cart.');
-    $icon_attributes['class'][] = 'cart-block-icon';
-    if ($variables['cart_empty']) {
-      $icon_attributes['class'][] = 'empty';
-    }
-    $output .= l('<span ' . new Attribute($icon_attributes) . '></span>', 'cart', array('html' => TRUE));
-  }
-
-  $attributes = array();
-  if ($variables['collapsible']) {
-    $attributes['title'] = t('Show/hide shopping cart contents.');
-    $attributes['class'][] = 'cart-block-arrow';
-    if ($variables['collapsed']) {
-      $attributes['class'][] = 'collapsed';
-    }
-  }
-  $output .= '<span ' . new Attribute($attributes) . '>' . $variables['title'] . '</span>';
-
-  return $output;
-}
 
 /**
  * Themes the cart checkout button(s).
