summaryrefslogtreecommitdiff
path: root/iridescence/src/components
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-12-03 18:18:57 -0500
committerAdam T. Carpenter <atc@53hor.net>2020-12-03 18:18:57 -0500
commit8280cf98c9a33613c7440442b73636e39dd297bc (patch)
tree9ed3494088585fe6309dac766eb91e5b4991c5e4 /iridescence/src/components
parent5751052a0df80260ea9e7c66ee222e95de4e35e3 (diff)
downloadtheglassyladies-8280cf98c9a33613c7440442b73636e39dd297bc.tar.xz
theglassyladies-8280cf98c9a33613c7440442b73636e39dd297bc.zip
when item cart count is 0, item is removed from cart display
Diffstat (limited to 'iridescence/src/components')
-rw-r--r--iridescence/src/components/cart/CartItem.vue35
1 files changed, 30 insertions, 5 deletions
diff --git a/iridescence/src/components/cart/CartItem.vue b/iridescence/src/components/cart/CartItem.vue
index c39ab13..2c7655a 100644
--- a/iridescence/src/components/cart/CartItem.vue
+++ b/iridescence/src/components/cart/CartItem.vue
@@ -17,14 +17,34 @@
</strong>
</div>
</div>
- <div class="level-item">
- <button class="button is-static">
- {{ inCart }}
- </button>
- </div>
</div>
<div class="level-right">
<div class="level-item">
+ <div class="field has-addons">
+ <p class="control is-expanded">
+ <a class="button is-static is-fullwidth">
+ {{ inCart }} in cart
+ </a>
+ </p>
+ <div class="control">
+ <a
+ @click="incrementCartQuantity(-1)"
+ class="button is-info is-outlined"
+ >
+ -
+ </a>
+ </div>
+ <div class="control">
+ <a
+ @click="incrementCartQuantity(1)"
+ class="button is-info is-outlined"
+ >
+ +
+ </a>
+ </div>
+ </div>
+ </div>
+ <div class="level-item">
<button class="button is-outlined is-danger">
Remove
</button>
@@ -54,6 +74,11 @@ export default {
process.env.VUE_APP_IMAGE_ROOT + "/" + this.product.photo_thumbnail
);
}
+ },
+ methods: {
+ incrementCartQuantity(by) {
+ this.$store.commit("cartItem", { id: this.id, by });
+ }
}
};
</script>