From 2e4678c40a7c92a981bf67845a2888893ea9b758 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 25 Jul 2021 00:55:53 +0200 Subject: Boilerplate checkout cart. --- client/src/views/Checkout.vue | 30 ++++++++++++++++++++++++++++-- client/src/views/Product.vue | 6 +++++- 2 files changed, 33 insertions(+), 3 deletions(-) (limited to 'client/src/views') diff --git a/client/src/views/Checkout.vue b/client/src/views/Checkout.vue index 42523ca..891597e 100644 --- a/client/src/views/Checkout.vue +++ b/client/src/views/Checkout.vue @@ -1,9 +1,35 @@ diff --git a/client/src/views/Product.vue b/client/src/views/Product.vue index 3c35b35..11643c1 100644 --- a/client/src/views/Product.vue +++ b/client/src/views/Product.vue @@ -46,7 +46,11 @@ export default { }, methods: { buy() { - + this.$store.commit('addToCart', { + _id: this.$route.params.id, + name: this.productName, + price: this.productPrice + }); } } } -- cgit v1.2.3