feat: add product to cart from main page

This commit is contained in:
Vlad Stan 2023-07-13 11:01:14 +03:00
parent 7516e0bc99
commit e72f013d84
7 changed files with 14 additions and 53 deletions

View file

@ -605,6 +605,7 @@ const market = async () => {
},
addProductToCart(item) {
console.log('### addProductToCart', item)
let stallCart = this.shoppingCarts.find(s => s.id === item.stall_id)
if (!stallCart) {
stallCart = {
@ -624,6 +625,11 @@ const market = async () => {
product.orderedQuantity = Math.min(product.quantity, item.orderedQuantity || (product.orderedQuantity + 1))
this.$q.localStorage.set('nostrmarket.shoppingCarts', this.shoppingCarts)
this.$q.notify({
type: 'positive',
message: 'Product added to cart!'
})
},
removeProductFromCart(item) {