summaryrefslogtreecommitdiff
path: root/iridescence/src/components/CartCheckout.vue
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-11-23 17:29:58 -0500
committerAdam T. Carpenter <atc@53hor.net>2020-11-23 17:29:58 -0500
commit2e7da5ab02ffa8b07fede7f6cd7e5dbbd90fac5f (patch)
treef1d29c4e00174540821d3f8cd9e9b3d943f90f26 /iridescence/src/components/CartCheckout.vue
parent58c7f82c2cbf2f2ff3f5c2dd559e570924a41a4a (diff)
downloadtheglassyladies-2e7da5ab02ffa8b07fede7f6cd7e5dbbd90fac5f.tar.xz
theglassyladies-2e7da5ab02ffa8b07fede7f6cd7e5dbbd90fac5f.zip
finished up product detail functionality, started checkout and cart
views
Diffstat (limited to 'iridescence/src/components/CartCheckout.vue')
-rw-r--r--iridescence/src/components/CartCheckout.vue25
1 files changed, 17 insertions, 8 deletions
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>