summaryrefslogtreecommitdiff
path: root/iridescence/src/components/CartCheckout.vue
blob: 19ad70699932d3957ecacc98f0567fab7568cca5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<template>
  <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",
  computed: {
    inCart() {
      return Object.values(this.$store.state.cart).reduce(
        (acc, cur) => acc + cur,
        0
      );
    }
  }
};
</script>