From 2e7da5ab02ffa8b07fede7f6cd7e5dbbd90fac5f Mon Sep 17 00:00:00 2001
From: "Adam T. Carpenter" <atc@53hor.net>
Date: Mon, 23 Nov 2020 17:29:58 -0500
Subject: finished up product detail functionality, started checkout and cart
 views

---
 iridescence/src/components/CartCheckout.vue | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

(limited to 'iridescence/src/components/CartCheckout.vue')

diff --git a/iridescence/src/components/CartCheckout.vue b/iridescence/src/components/CartCheckout.vue
index ec72acf..19ad706 100644
--- a/iridescence/src/components/CartCheckout.vue
+++ b/iridescence/src/components/CartCheckout.vue
@@ -1,15 +1,24 @@
 <template>
-  <div class="buttons">
-    <button class="button">
-      Cart (5)
-    </button>
-    <button class="button is-info">
-      Checkout
-    </button>
+  <div id="cartCheckout">
+    <div class="buttons">
+      <router-link to="/cart" class="button">Cart ({{ inCart }})</router-link>
+      <router-link to="/checkout" class="button is-primary">
+        Checkout
+      </router-link>
+    </div>
   </div>
 </template>
+
 <script>
 export default {
-  name: "CartCheckout"
+  name: "CartCheckout",
+  computed: {
+    inCart() {
+      return Object.values(this.$store.state.cart).reduce(
+        (acc, cur) => acc + cur,
+        0
+      );
+    }
+  }
 };
 </script>
-- 
cgit v1.2.3

